From 244bf49dad13d6e04a324693bafbe03ab45ed28f Mon Sep 17 00:00:00 2001 From: Julio Cesar Laura Date: Mon, 17 Dec 2012 09:13:25 -0400 Subject: [PATCH] Add little validation with property not found --- gulliver/system/class.dynaformhandler.php | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/gulliver/system/class.dynaformhandler.php b/gulliver/system/class.dynaformhandler.php index d28fa53b2..40eae1945 100755 --- a/gulliver/system/class.dynaformhandler.php +++ b/gulliver/system/class.dynaformhandler.php @@ -384,14 +384,18 @@ class dynaFormHandler } foreach ($av as $e) { $xnode = $this->root->getElementsByTagName($e)->item(0); - if ($xnode->nodeType == XML_ELEMENT_NODE) { - $dropednode = $this->root->removeChild($xnode); - /* evaluation field aditional routines */ - $xpath = new DOMXPath($this->dom); - $nodeList = $xpath->query("/dynaForm/JS_$e"); - if ($nodeList->length != 0) { - $tmp_node = $nodeList->item(0); - $this->root->removeChild($tmp_node); + if (isset($xnode->nodeType)) { + if ($xnode->nodeType == XML_ELEMENT_NODE) { + $dropednode = $this->root->removeChild($xnode); + /* evaluation field aditional routines */ + $xpath = new DOMXPath($this->dom); + $nodeList = $xpath->query("/dynaForm/JS_$e"); + if ($nodeList->length != 0) { + $tmp_node = $nodeList->item(0); + $this->root->removeChild($tmp_node); + } + } else { + print("[Class dynaFormHandler] ERROR: The \"$e\" element doesn't exist!
"); } } else { print("[Class dynaFormHandler] ERROR: The \"$e\" element doesn't exist!
");