Search Issue Tracker
Fixed
Fixed in 2022.3.21f1, 2023.2.12f1, 2023.3.0b8
Votes
0
Found in
2022.3.17f1
2023.2.3f1
2023.3.0b5
Issue ID
UUM-61145
Regression
Yes
[Error] Game object with AudioListener and OnAudioFilterRead throws an error when drawing the inspector
When using `OnAudioFilterRead` with an `AudioListener`, a null reference error is thrown in the console.
*Repro*
# Download and open the attached project `OAFR Error Repro.zip`.
# Open SampleScene.
# Click on the Main Camera game object.
Expected: No error is thrown in the console and the `OAFR` component shows the VU meter.
Actual: A null reference error is thrown in the console, but the `OAFR` component does show the VU meter.
*Regression details*
This is related to the VU meter implementation, which was absent through versions 2022.2.0a9 (see bisection comment) to 2023.3.0a13 ([PR|https://github.cds.internal.unity3d.com/unity/unity/pull/38545]). The same problem is present in 2022.2.0a8 when the VU meter was still there, so that [PR|https://github.cds.internal.unity3d.com/unity/unity/pull/38545] should not be marked as the one that regressed.
Reproducible on 2022.3.X, 2023.2.X, and 2023.3.X
Not reproducible on 2021.3.34f1.
*Stack trace*
{code:java}
NullReferenceException: Object reference not set to an instance of an object
UnityEditor.AudioFilterGUI.DrawAudioFilterGUI (UnityEngine.MonoBehaviour behaviour) (at /Users/kristinnbragi/gitrepo/trunk/Editor/Mono/Inspector/AudioFilterGUI.cs:42)
UnityEditor.Audio.UIElements.OnAudioFilterReadLevelMeter+<>c__DisplayClass1_0.<.ctor>b__0 () (at /Users/kristinnbragi/gitrepo/trunk/Editor/Mono/Audio/UIElements/OnAudioFilterReadLevelMeter.cs:12)
UnityEngine.UIElements.IMGUIContainer.DoOnGUI (UnityEngine.Event evt, UnityEngine.Matrix4x4 parentTransform, UnityEngine.Rect clippingRect, System.Boolean isComputingLayout, UnityEngine.Rect layoutSize, System.Action onGUIHandler, System.Boolean canAffectFocus) (at /Users/kristinnbragi/gitrepo/trunk/Modules/UIElements/Core/IMGUIContainer.cs:396)
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)
UnityEngine.UIElements.IMGUIContainer:DoOnGUI(Event, Matrix4x4, Rect, Boolean, Rect, Action, Boolean) (at /Users/kristinnbragi/gitrepo/trunk/Modules/UIElements/Core/IMGUIContainer.cs:411)
UnityEngine.UIElements.IMGUIContainer:DoMeasure(Single, MeasureMode, Single, MeasureMode) (at /Users/kristinnbragi/gitrepo/trunk/Modules/UIElements/Core/IMGUIContainer.cs:882)
UnityEngine.UIElements.VisualElement:Measure(VisualElement, LayoutNode&, Single, LayoutMeasureMode, Single, LayoutMeasureMode, LayoutSize&) (at /Users/kristinnbragi/gitrepo/trunk/Modules/UIElements/Core/VisualElement.cs:2190)
UnityEngine.UIElements.Layout.LayoutDelegates:InvokeMeasureFunction(LayoutNode&, Single, LayoutMeasureMode, Single, LayoutMeasureMode, LayoutSize&) (at /Users/kristinnbragi/gitrepo/trunk/Modules/UIElements/Core/Layout/LayoutProcessor.cs:75)
UnityEngine.UIElements.Layout.LayoutNative:CalculateLayout(IntPtr, Single, Single, Int32, IntPtr)
UnityEngine.UIElements.Layout.LayoutProcessorNative:UnityEngine.UIElements.Layout.ILayoutProcessor.CalculateLayout(LayoutNode, Single, Single, LayoutDirection) (at /Users/kristinnbragi/gitrepo/trunk/Modules/UIElements/Core/Layout/Native/LayoutProcessorNative.cs:35)
UnityEngine.UIElements.Layout.LayoutProcessor:CalculateLayout(LayoutNode, Single, Single, LayoutDirection) (at /Users/kristinnbragi/gitrepo/trunk/Modules/UIElements/Core/Layout/LayoutProcessor.cs:32)
UnityEngine.UIElements.Layout.LayoutNode:CalculateLayout(Single, Single) (at /Users/kristinnbragi/gitrepo/trunk/Modules/UIElements/Core/Layout/LayoutNode.cs:324)
UnityEngine.UIElements.UIRLayoutUpdater:Update() (at /Users/kristinnbragi/gitrepo/trunk/Modules/UIElements/Core/Renderer/UIRLayoutUpdater.cs:152)
UnityEngine.UIElements.VisualTreeUpdater:UpdateVisualTreePhase(VisualTreeUpdatePhase) (at /Users/kristinnbragi/gitrepo/trunk/Modules/UIElements/Core/VisualTreeUpdater.cs:116)
UnityEngine.UIElements.Panel:UpdateWithoutRepaint() (at /Users/kristinnbragi/gitrepo/trunk/Modules/UIElements/Core/Panel.cs:1266)
UnityEditor.EditorElementUpdater:CreateInspectorElementsForViewport(ScrollView, VisualElement) (at /Users/kristinnbragi/gitrepo/trunk/Editor/Mono/Inspector/EditorElementUpdater.cs:104)
UnityEditor.PropertyEditor:RebuildContentsContainers() (at /Users/kristinnbragi/gitrepo/trunk/Editor/Mono/Inspector/Core/PropertyEditor.cs:1186)
UnityEditor.InspectorWindow:RedrawFromNative() (at /Users/kristinnbragi/gitrepo/trunk/Editor/Mono/Inspector/Core/InspectorWindow.cs:202) {code}
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
- [Android][iOS] The keyboard closes and re-opens when consecutive input fields are selected
- Complex Sub Graph connected to a Voronoi node is ignored when the shader gets applied as a Material
- Compute Shader property not set error when entering play mode with path tracing and PBR sky
- "WebGL Publish" detects WebGL module and allows building when it is installed without restarting the project
- Editor is non-responsive and flickers when multiple Water System instances are enabled
Resolution Note (fix version 2023.3.0b8):
Fixed an issue that would sometimes cause a game object to throw an error in the log when drawing the game objects inspector, if the game object implements OnAudioFilterRead.
Resolution Note (fix version 2023.2.12f1):
Fixed an issue that would sometimes cause a game object to throw an error in the log when drawing the game objects inspector, if the game object implements OnAudioFilterRead.
Resolution Note (fix version 2022.3.21f1):
Fixed an issue that would sometimes cause a game object to throw an error in the log when drawing the game objects inspector, if the game object implements OnAudioFilterRead.