Search Issue Tracker
Active
Under Consideration for 6000.6.X
Votes
0
Found in
6000.0.60f1
6000.3.10f1
6000.4.0b10
6000.5.0a7
6000.6.0a1
Issue ID
UUM-136377
Regression
No
NullReferenceException and empty Build Profiles window when BuildProfileContext.asset contains invalid script reference
Steps to reproduce:
- Create a new unity project
- Open Build Profile Window
- Add a new Build Profile (Library/BuildProfileContext.asset should be created)
- Close the Editor
- Open Library/BuildProfileContext.asset and change the m_Script field from the valid built in reference to any invalid one, e.g.
- m_Script: \{fileID: 11500000, guid: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa, type: 3}
- Save the file and reopen the Editor
- Open Window > Build Profiles
Actual results: Console errors and classic platforms list and user-created profiles list are both empty
Expected results: The Build Profiles window should open normally with all platforms and profiles present.
Reproducible with versions: 6000.0.60f1, 6000.6.0a1
Tested on (OS): MacOS
{code:java}
BuildProfileContext asset exists but could not be loaded.
UnityEditor.EditorApplication:Internal_CallGlobalEventHandler () (at /Users/bokken/build/output/unity/unity/Editor/Mono/EditorApplication.cs:570)
NullReferenceException: Object reference not set to an instance of an object
UnityEditor.Build.Profile.BuildProfileContext.CreateOrLoad () (at /Users/bokken/build/output/unity/unity/Editor/Mono/BuildProfile/BuildProfileContext.cs:746)
UnityEditor.Build.Profile.BuildProfileContext.get_instance () (at /Users/bokken/build/output/unity/unity/Editor/Mono/BuildProfile/BuildProfileContext.cs:206)
UnityEditor.Build.Profile.Handlers.BuildProfileDataSource..ctor (UnityEditor.Build.Profile.BuildProfileWindow window) (at /Users/bokken/build/output/unity/unity/Modules/BuildProfileEditor/Handlers/BuildProfileDataSource.cs:20)
UnityEditor.Build.Profile.BuildProfileWindow.CreateGUI () (at /Users/bokken/build/output/unity/unity/Modules/BuildProfileEditor/BuildProfileWindow.cs:170)
System.Reflection.RuntimeMethodInfo.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <3eb0070ec3184acfa9cdfc9616bb21ab>:0)
Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
System.Reflection.RuntimeMethodInfo.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <3eb0070ec3184acfa9cdfc9616bb21ab>:0)
System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at <3eb0070ec3184acfa9cdfc9616bb21ab>:0)
UnityEditor.UIElements.DefaultEditorWindowBackend.Invoke (System.String methodName) (at /Users/bokken/build/output/unity/unity/Modules/UIElementsEditor/WindowBackends/DefaultEditorWindowBackend.cs:387)
UnityEditor.EditorApplication:Internal_CallGlobalEventHandler() (at /Users/bokken/build/output/unity/unity/Editor/Mono/EditorApplication.cs:570)
{code}
Notes:
- Workaround: delete Library/BuildProfileContext.asset and reopen the Editor.
- I could not reproduce organically. The repro above manually corrupts the asset file to trigger the code path. But there are multiple reports of this occurring naturally in our Discussions forums
- [https://discussions.unity.com/t/my-build-profile-no-longer-shows-up/1619616]
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- NullReferenceException and empty Build Profiles window when BuildProfileContext.asset contains invalid script reference
- VFX Select Unused Properties context menu option selects nodes that are treated as used
- Material's icon doesn't fit the "Material preview not available" text when the Material doesn't have a preview
- Two fields in GLTF Importer Inspector are misaligned with other settings
- Duplicate image components can be added in m_TrackedTextureLess images and are never removed
Add comment