소스 검색

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];
 	}