瀏覽代碼

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