Просмотр исходного кода

fixed firstChild() in case of empty node

Nicolas Cannasse 17 лет назад
Родитель
Сommit
46fdbbb951
1 измененных файлов с 1 добавлено и 0 удалено
  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];
 	}