Hui WuMarch 31, 2020 14:52
We use reflection to deserialize some value into C# types. We encounter an issue where if we have a
class NullableContainer {
public Int64? NullableValue { get; set; }
}
And if we want to set a `null` to `NullableValue` via reflection: PropertyInfo.SetValue, the value is set to a meaningless non-zero number.
I tried to trace where the issue is, and it looks like the NULL set by generated IL2CPP code, is eventually getting interpreted as an empty array, and then the first element is read to be the value.
Is this a known issue? Is there a walk-around?
↧
IL2CPP: PROPERTYINFO.SETVALUE SETS A RANDOM NUMBER TO A NULLABLE VALUE TYPE WHEN NULL IS EXPECTED.
↧