mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-19 00:28:47 +02:00
Protection against attemp to delete a non-existing node in the XML...
SVN:trunk[3038]
This commit is contained in:
@@ -343,6 +343,10 @@ class ModelFactory
|
||||
|
||||
case 'delete':
|
||||
$oTargetNode = $oTargetParentNode->FindExistingChildNode($oSourceNode);
|
||||
if($oTargetNode == null)
|
||||
{
|
||||
throw new Exception("Trying to delete node for {$oSourceNode->tagName} (id:".$oSourceNode->getAttribute('id').") under {$oTargetParentNode->tagName} (id:".$oTargetParentNode->getAttribute('id').'). but nothing found.');
|
||||
}
|
||||
$oTargetNode->Delete();
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user