Explorar o código

added some explicit null checks (match flash impl + we null check anyway)

Nicolas Cannasse %!s(int64=9) %!d(string=hai) anos
pai
achega
555cdebe23
Modificáronse 1 ficheiros con 3 adicións e 0 borrados
  1. 3 0
      std/hl/_std/haxe/ds/StringMap.hx

+ 3 - 0
std/hl/_std/haxe/ds/StringMap.hx

@@ -58,14 +58,17 @@ class StringMap<T> implements haxe.Constraints.IMap<String,T> {
 	}
 
 	public function get( key : String ) : Null<T> {
+		if( key == null ) return null;
 		return @:privateAccess h.get(key.bytes);
 	}
 
 	public function exists( key : String ) : Bool {
+		if( key == null ) return false;
 		return @:privateAccess h.exists(key.bytes);
 	}
 
 	public function remove( key : String ) : Bool {
+		if( key == null ) return false;
 		return @:privateAccess h.remove(key.bytes);
 	}