Browse Source

fixed Xml.parent (fixed issue #766)

Nicolas Cannasse 13 years ago
parent
commit
f90c9efd73
2 changed files with 5 additions and 1 deletions
  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
 2012-04-14: 2.09
 	all : optimized const == const and const != const (with different const types)
 	all : optimized const == const and const != const (with different const types)
 	all : add Type.allEnums(e)
 	all : add Type.allEnums(e)

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

@@ -175,7 +175,8 @@ enum XmlType {
 	}
 	}
 
 
 	private function getParent() :Xml {
 	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 {
 	private static function wrap( map : flash.utils.Dictionary, node : XML, ?type : XmlType ) : Xml {