浏览代码

fixed firstChild() in case of empty node

Nicolas Cannasse 17 年之前
父节点
当前提交
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];
 	}