Search Issue Tracker

In Progress

Under Consideration for 2022.3.X

Votes

4

Found in

2022.3.27f1

6000.0.1f1

Issue ID

UUM-71255

Regression

Yes

Deleting AudioMixer asset throws MissingReferenceException and breaks the Audio Mixer window

--

-

*Steps to reproduce:*
# Create and open an empty project.
# Create an audio mixer asset (Assets > Create > Audio > Audio Mixer).
# Open the audio mixer asset, so that it shows in the audio mixer window.
# Make sure the audio mixer window is docked next to another window.
# Switch tabs, so that the audio mixer window is hidden.
# Close Unity.
# Reopen the project.
# Delete the audio mixer asset.
# Extra: Switch to the audio mixer window, so that it is in focus.

*Actual results:* The console throws an error and the audio mixer window breaks, rendering empty (uniform, flat gray color) when you switch to it and throwing a bunch of errors.

*Expected results:* No errors are thrown and the audio window renders its default state, showing the list of mixers on the left.

*Reproducible with versions:*
6000.0.1f1
2022.3.27f1

*Not reproducible with versions:* 
2021.3.37f1

*Tested on (OS):* MacOS, M1, 13.6.6

*Notes:*
* Going back to the Audio Mixer window reveals the brokenness.

*Stack trace*
{code:java}
MissingReferenceException: The object of type 'UnityEditor.Audio.AudioMixerController' has been destroyed but you are still trying to access it.
Your script should either check if it is null or you should not destroy the object.
UnityEngine.Object+MarshalledUnityObject.TryThrowEditorNullExceptionObject (UnityEngine.Object unityObj, System.String parameterName) (at /Users/kristinnbragi/gitrepo/trunk/Runtime/Export/Scripting/UnityEngineObject.bindings.cs:815)
UnityEngine.Bindings.ThrowHelper.ThrowNullReferenceException (System.Object obj) (at /Users/kristinnbragi/gitrepo/trunk/Runtime/Export/Scripting/BindingsHelpers.cs:61)
UnityEngine.Object.GetName () (at <2b2e7898a92a45ccb65811e5e100662f>:0)
UnityEngine.Object.get_name () (at /Users/kristinnbragi/gitrepo/trunk/Runtime/Export/Scripting/UnityEngineObject.bindings.cs:215)
UnityEditor.AudioMixersDataSource.<FetchData>b__2_0 (UnityEditor.Audio.AudioMixerController mixer) (at /Users/kristinnbragi/gitrepo/trunk/Editor/Mono/Audio/Mixer/GUI/AudioMixersTreeView.cs:212)
System.Linq.Enumerable+SelectListIterator`2[TSource,TResult].ToList () (at <f33d99e10d0143be9e6d6385d146b91b>:0)
System.Linq.Enumerable.ToList[TSource] (System.Collections.Generic.IEnumerable`1[T] source) (at <f33d99e10d0143be9e6d6385d146b91b>:0)
UnityEditor.AudioMixersDataSource.FetchData () (at /Users/kristinnbragi/gitrepo/trunk/Editor/Mono/Audio/Mixer/GUI/AudioMixersTreeView.cs:212)
UnityEditor.IMGUI.Controls.TreeViewDataSource.ReloadData () (at /Users/kristinnbragi/gitrepo/trunk/Editor/Mono/GUI/TreeView/TreeViewDataSource.cs:54)
UnityEditor.IMGUI.Controls.TreeViewController.ReloadData () (at /Users/kristinnbragi/gitrepo/trunk/Editor/Mono/GUI/TreeView/TreeViewController.cs:371)
UnityEditor.AudioMixersTreeView..ctor (UnityEditor.AudioMixerWindow mixerWindow, UnityEditor.IMGUI.Controls.TreeViewState treeState, System.Func`1[TResult] getAllControllersCallback) (at /Users/kristinnbragi/gitrepo/trunk/Editor/Mono/Audio/Mixer/GUI/AudioMixersTreeView.cs:543)
UnityEditor.AudioMixerWindow.Init () (at /Users/kristinnbragi/gitrepo/trunk/Editor/Mono/Audio/Mixer/GUI/AudioMixerWindow.cs:207)
UnityEditor.AudioMixerWindow.UpdateAfterAssetChange () (at /Users/kristinnbragi/gitrepo/trunk/Editor/Mono/Audio/Mixer/GUI/AudioMixerWindow.cs:136)
UnityEditor.AudioMixerWindow+AudioMixerPostprocessor.OnPostprocessAllAssets (System.String[] importedAssets, System.String[] deletedAssets, System.String[] movedAssets, System.String[] movedFromPath) (at /Users/kristinnbragi/gitrepo/trunk/Editor/Mono/Audio/Mixer/GUI/AudioMixerWindow.cs:128)
System.Reflection.RuntimeMethodInfo.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <24895ab5717c46559ecc60ae3bf90417>: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 <24895ab5717c46559ecc60ae3bf90417>:0)
System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at <24895ab5717c46559ecc60ae3bf90417>:0)
UnityEditor.AssetPostprocessingInternal.InvokeMethod (System.Reflection.MethodInfo method, System.Object[] args) (at /Users/kristinnbragi/gitrepo/trunk/Editor/Mono/AssetPostprocessor.cs:1168)
UnityEditor.AssetPostprocessingInternal.PostprocessAllAssets (System.String[] importedAssets, System.String[] addedAssets, System.String[] deletedAssets, System.String[] movedAssets, System.String[] movedFromPathAssets, System.Boolean didDomainReload) (at /Users/kristinnbragi/gitrepo/trunk/Editor/Mono/AssetPostprocessor.cs:403)
UnityEngine.DebugLogHandler:Internal_LogException_Injected(Exception, IntPtr)
UnityEngine.DebugLogHandler:Internal_LogException(Exception, Object)
UnityEngine.DebugLogHandler:LogException(Exception, Object)
UnityEngine.Logger:LogException(Exception, Object)
UnityEngine.Debug:LogException(Exception)
UnityEditor.AssetPostprocessingInternal:PostprocessAllAssets(String[], String[], String[], String[], String[], Boolean) (at /Users/kristinnbragi/gitrepo/trunk/Editor/Mono/AssetPostprocessor.cs:408)
UnityEditor.AssetDatabase:StopAssetEditing()
UnityEditor.ProjectWindowUtil:DeleteAssets(List`1, Boolean) (at /Users/kristinnbragi/gitrepo/trunk/Editor/Mono/ProjectBrowser/ProjectWindowUtil.cs:1124)
UnityEditor.ProjectBrowser:DeleteSelectedAssets(Boolean) (at /Users/kristinnbragi/gitrepo/trunk/Editor/Mono/ProjectBrowser/ProjectBrowser.cs:3026) {code}

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.