Преглед на файлове

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

Nicolas Cannasse преди 9 години
родител
ревизия
555cdebe23
променени са 1 файла, в които са добавени 3 реда и са изтрити 0 реда
  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);
 	}