Search Issue Tracker
Fixed in 2022.1.X
Votes
3
Found in
2019.4
2020.3
2020.3.18f1
2021.1
2021.2
2022.1
Issue ID
1364809
Regression
No
Accessing a Scriptable Object with InitializeOnLoad provides null values when Reload Domain is disabled
How to reproduce:
1. Open the user's attached project
2. Open scene Scenes/SampleScene
3. Make sure that Domain Reloading is disabled (Project Settings -> Editor -> Reload Domain (under "Enter Play Mode Settings) -> unchecked)
4. Press the Play button
5. Observe the Console
6. Press the Play button again to stop playing
7. Enable Domain Reloading (Project Settings -> Editor -> Reload Domain (under "Enter Play Mode Settings) -> checked)
8. Press the Play button again
9. Observe the Console
Expected result: no errors regarding missing references or null values are thrown
Actual result: MissingReferenceException is thrown after initially playing the project, the error is resolved after enabling Reload Domain
Reproducible with: 2019.4.30f1, 2020.3.18f1, 2021.1.21f1, 2021.2.0b12, 2022.1.0a8
-
Delvatron
Sep 14, 2021 20:35
It's a runtime error in editor mode only. But it is present when assets are loaded in a InitializeOnLoad context (when using GetPreloadedAssets for instance). Since domain reloading is disabled, upon running the game the assets are not completly loaded (and will never be until next domain reload which will reload memory)
-
tomachinz
Sep 14, 2021 16:05
Isn't that a runtime error?
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
- Articulation Body with 'Revolute' Joint Type has erratic behavior when Upper Limit is set to above 360
- WebGL Player fails to render Scene when Terrain with Detail Mesh is added and WebGPU Graphics API is used
- Inconsistent errors are logged when different types are passed into the Query "Q<>" method in UIToolkit and the ancestor VisualElement is null
- Crash on GetMaterialPropertyByIndex when opening a specific Scene
- Discrepancies in the styling are present when using a TSS file instead of a USS file in custom EditorWindow
Resolution Note (fix version 2022.1):
Fixed in 2022.1.0a12