Explorar o código

fixed firstChild() in case of empty node

Nicolas Cannasse %!s(int64=17) %!d(string=hai) anos
pai
achega
46fdbbb951
Modificáronse 1 ficheiros con 1 adicións e 0 borrados
  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];
 	}