Closed andreweades closed 3 years ago
@andreweades Can you provide steps to reproduce? We have a test for NSNumber
that is passing on all platforms, so I'm not quite sure why you're seeing a crash.
OK. I can share the project with you...
I went back to the commit that had the NSNumber crash. And of course, it works now. I'll keep digging to see if I can isolate the problem to something else.
Here we go:
I can reproduce by setting the property to NSnumber.init()
And I will get these errors:
Found unexpected null pointer value while trying to cast value of type 'NSNumber' (0x7f99bc050278) to 'CustomDump.CustomDumpReflectable' (0x7f99cb832df0) 2021-10-09 16:06:24.738750+0100 BluetoothCentralCA[85223:1176312] Found unexpected null pointer value while trying to cast value of type 'NSNumber' (0x7f99bc050278) to 'CustomDump.CustomDumpReflectable' (0x7f99cb832df0) Found unexpected null pointer value while trying to cast value of type 'NSNumber' (0x7f99bc050278) to 'CustomDump.CustomDumpReflectable' (0x7f99cb832df0)
I've shared a repo with you with the bug exposed. Hope this helps.
Dumping a struct with an NSNumber crashes CustomDump. Storing the number as Double fixes the issue for me. The NSNumber is coming out of CoreBluetooh's API so pretty old and low-level.