Search Issue Tracker
By Design
Votes
0
Found in [Package]
7.0.0
Issue ID
MXPB-8
Regression
Yes
Error “NullReferenceException: Object reference not set to an instance of an object“ when ML Spatial Mapper Component is added
Reproduction steps:
1. Open the attached project "ReproProj"
2. Open the “/Assets/Scenes/SampleScene.unity” Scene
3. In Hierarchy, select the “Directional Light” GameObject
4. Observe the Console window
Expected result: No errors are present
Actual result: Error “NullReferenceException: Object reference not set to an instance of an object“ is spammed
Reproducible with: 7.0.0-exp.3 (2022.2.16f1), 7.0.0 (2021.3.35f1, 2022.3.20f1, 2023.2.12f1, 2023.3.0b9)
Not reproducible with: 6.4.2-preview.2 (2022.2.16f1)
Reproducible on: Windows 10 Enterprise 21H2
Not reproducible on: No other environment tested
Workaround:
In MLSpatialMapper.cs (Packages/com.unity.xr.magicleap/Runtime/Meshing/MLSpatialMapper.cs), change line:
{{m_MeshType = this.serializedObject.FindProperty("m_MeshType"); }}
to:
{{m_MeshType = this.serializedObject.FindProperty("m_RequestedMeshType");}}
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- GetCurrentAnimatorClipInfoCount() and GetNextAnimatorClipInfoCount() return 0 when animator is in transition
- GPU utilization increases by 20% on Meta Quest headsets when Render Graph is enabled on 6000.0.16f1 and higher
- Value on Slider (Int) control in UI Builder displays as default when saving UI Document
- Color mismatch in UI Builders Library panel when the Editors theme is set to Light Mode
- [Android ] "AndroidJNI.ToBooleanArray" returns a random non-zero value instead of "IntPtr.Zero" when the method argument is null
Resolution Note:
The `FormerlySerializedAs` attribute is only meant to be used for serialized objects on disk, not for serialized objects in memory which is what the FindProperty() function works on.
The recommended solution is to update the string used in the FindProperty() function.