Search Issue Tracker
By Design
Votes
0
Found in [Package]
1.19.19
Issue ID
ADDR-2684
Regression
No
{Addressables] AssetReference.editorAsset occasionally fails to load an Asset
How to reproduce:
1. Open the attached "1414841_Repro.zip" project
2. Open the Scene "SampleScene" (found in the Assets/Scenes folder)
3. Enter the Play Mode
Expected results: No errors are thrown
Actual results: The "Editor asset is null" error is thrown (one or multiple)
Reproducible with: 1.19.19 (2019.4.38f1, 2020.3.33f1, 2021.3.1f1, 2022.1.0f1, 2022.2.0a11)
Note:
- It seems that the failure rate isn't consistent and can't pinpoint when it will fail to load
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
- ScrollView speed is slower when entering Play mode
- UI Builder elements disappear and "Semantic - Unknown template name" error appears when changes to "Template" parameter are saved
- Renderers outside Light Probe hull use incorrect Ambient Probe values when "Renderer Light Probe Selection" is set to "Use Ambient Probe" and "Light Probes" on Mesh is set to "Blend Probes"
- ArgumentNullException error occurs when selecting a Camera in the Hierarchy with the Scene view open
- Clicking 'Open Editor Log' through the Console fails to open redirected Logs when relative Log files exist outside of the Project root
Resolution Note:
Problem is with the project.
In the project "pvp_road_card" has AssetReference and AssetReference2 not set to any asset.
The issue is then with the check for `if (assetRef == null)`. AssetReference is not the same as a direct reference to say a GameObject that can be check for null. Although it is a class and can be null. In this case the project has them as [SerializeField], this means that AssetReference class data will be serialised with default data and not be null.
To correctly address a serialised field as not being assigned `if (assetRef == null || assetRef.RuntimeKeyIsValid() == false)` should be used.