소스 검색

fixed Xml.parent (fixed issue #766)

Nicolas Cannasse 13 년 전
부모
커밋
f90c9efd73
2개의 변경된 파일5개의 추가작업 그리고 1개의 파일을 삭제
  1. 3 0
      doc/CHANGES.txt
  2. 2 1
      std/flash/_std/Xml.hx

+ 3 - 0
doc/CHANGES.txt

@@ -1,3 +1,6 @@
+2012-??-??: 3.0
+	flash : fixed Xml.parent exception if parent does not exists
+	
 2012-04-14: 2.09
 	all : optimized const == const and const != const (with different const types)
 	all : add Type.allEnums(e)

+ 2 - 1
std/flash/_std/Xml.hx

@@ -175,7 +175,8 @@ enum XmlType {
 	}
 
 	private function getParent() :Xml {
-		return wrap( _map, _node.parent() );
+		var p = _node.parent();
+		return p == null ? null : wrap( _map, p );
 	}
 
 	private static function wrap( map : flash.utils.Dictionary, node : XML, ?type : XmlType ) : Xml {