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
Comments (2)
-
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
- “Remove Unused Overrides” available on not loaded Scene and throws “ArgumentException: The scene is not loaded” warning
- Adaptive Probe Volume occlusion edge is calculated incorrectly when viewing probes near geometry edges
- Sampling a texture using an HLSL file throws shader errors and the code does not compile
- "Graphics.CopyTexture called with null source texture" error when Base Camera of an Overlay Camera is removed with DX11 Graphics API and Compatibility Mode enabled
- WebGL sends wrong value with large numbers when SendMessage function is used
Resolution Note (fix version 2022.1):
Fixed in 2022.1.0a12