فهرست منبع

fixed Context.definedValue returning "null" string

Nicolas Cannasse 12 سال پیش
والد
کامیت
1e461dbf31
1فایلهای تغییر یافته به همراه2 افزوده شده و 1 حذف شده
  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
 		Returns the value defined through -D key=value
 	**/
 	**/
 	public static function definedValue( key : String ) : String {
 	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);
 	}
 	}
 
 
 	/**
 	/**