ソースを参照

Fixes null reference exception when trying to use the non-existing MemberInfo for the field when operating on a property (#9392)

Martin Jonasson 5 年 前
コミット
fb5cfdf2d3
1 ファイル変更2 行追加2 行削除
  1. 2 2
      std/cs/internal/Runtime.hx

+ 2 - 2
std/cs/internal/Runtime.hx

@@ -370,9 +370,9 @@ import cs.system.Object;
 				value = mkNullable(value, prop.PropertyType);
 			}
 			if (Object.ReferenceEquals(Lib.toNativeType(cs.system.Double), Lib.getNativeType(value))
-				&& !Object.ReferenceEquals(t, f.FieldType)) {
+				&& !Object.ReferenceEquals(t, prop.PropertyType)) {
 				var ic = Lib.as(value, IConvertible);
-				value = ic.ToType(f.FieldType, null);
+				value = ic.ToType(prop.PropertyType, null);
 			}
 			prop.SetValue(obj, value, null);