Protection against attemp to delete a non-existing node in the XML...

SVN:trunk[3038]
This commit is contained in:
Denis Flaven
2013-12-10 16:43:22 +00:00
parent 934e500253
commit 3de2d654a0

View File

@@ -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;
}