Browse Source

fixed Context.definedValue returning "null" string

Nicolas Cannasse 12 years ago
parent
commit
1e461dbf31
1 changed files with 2 additions and 1 deletions
  1. 2 1
      std/haxe/macro/Context.hx

+ 2 - 1
std/haxe/macro/Context.hx

@@ -123,7 +123,8 @@ class Context {
 		Returns the value defined through -D key=value
 	**/
 	public static function definedValue( key : String ) : String {
-		return new String(load("defined_value", 1)(untyped key.__s));
+		var d = load("defined_value", 1)(untyped key.__s);
+		return d == null ? null : new String(d);
 	}
 
 	/**