Browse Source

fixed firstChild() in case of empty node

Nicolas Cannasse 17 years ago
parent
commit
46fdbbb951
1 changed files with 1 additions and 0 deletions
  1. 1 0
      std/php/PhpXml__.hx

+ 1 - 0
std/php/PhpXml__.hx

@@ -310,6 +310,7 @@ class PhpXml__ {
 
 	public function firstChild() : PhpXml__ {
 		if( _children == null ) throw "bad nodetype";
+		if( _children.length == 0 ) return null;
 		return _children[0];
 	}