Browse Source

Fix Unity hard crash when serializing a nullable `decimal`

pull/100/head
Meivyn 1 year ago
parent
commit
efdfee21dc
No known key found for this signature in database GPG Key ID: 8BDD3E48158B2F71
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      IPA.Loader/Config/Stores/GeneratedStoreImpl/Serialization.cs

+ 2
- 2
IPA.Loader/Config/Stores/GeneratedStoreImpl/Serialization.cs View File

@ -127,13 +127,13 @@ namespace IPA.Config.Stores
else if (targetType == typeof(Integer)) else if (targetType == typeof(Integer))
{ {
var IntCreate = typeof(Value).GetMethod(nameof(Value.Integer)); var IntCreate = typeof(Value).GetMethod(nameof(Value.Integer));
EmitNumberConvertTo(il, IntCreate.GetParameters()[0].ParameterType, member.Type);
EmitNumberConvertTo(il, IntCreate.GetParameters()[0].ParameterType, memberConversionType);
il.Emit(OpCodes.Call, IntCreate); il.Emit(OpCodes.Call, IntCreate);
} }
else if (targetType == typeof(FloatingPoint)) else if (targetType == typeof(FloatingPoint))
{ {
var FloatCreate = typeof(Value).GetMethod(nameof(Value.Float)); var FloatCreate = typeof(Value).GetMethod(nameof(Value.Float));
EmitNumberConvertTo(il, FloatCreate.GetParameters()[0].ParameterType, member.Type);
EmitNumberConvertTo(il, FloatCreate.GetParameters()[0].ParameterType, memberConversionType);
il.Emit(OpCodes.Call, FloatCreate); il.Emit(OpCodes.Call, FloatCreate);
} }
else if (targetType == typeof(List)) else if (targetType == typeof(List))


Loading…
Cancel
Save