Search Issue Tracker

Fixed

Fixed in 4.0.3, 5.1.1

Votes

1

Found in [Package]

4.0.2

5.1.1

Issue ID

APB-36

Regression

Yes

“NullReferenceException: Object reference not set to an instance of an object“ error is thrown when clicking on the disabled Default Scaler Profile setting

Package: Adaptive Performance

-

Reproduction steps:
1. Create a new project and install Adaptive Performance package
2. Go to Simulator Settings (Edit > Project Settings… > Adaptive Performance > Simulator)
3. Press on the disabled Framerate setting in the Default Scaler Profile dropdown
4. Observe the Console

Expected result: No errors are thrown
Actual result: “NullReferenceException: Object reference not set to an instance of an object“ error is thrown

Reproducible with: 5.1.0 (2021.3.41f1, 2022.3.39f1, 6000.0.12f1)
Not reproducible with: 5.0.2 (2022.3.39f1)

Reproduced on: macOS Sonoma 14.5 (Intel), Windows 11 (by the user)

Note:
Full error:
”NullReferenceException: Object reference not set to an instance of an object
UnityEditor.AdaptivePerformance.Editor.ProviderSettingsEditor.DrawScalerSetting (UnityEngine.Rect rect, UnityEditor.SerializedProperty scalerSetting, System.Boolean renderNotDisabled, UnityEditor.AdaptivePerformance.Editor.ProviderSettingsEditor+ScalerProfileSettingInformation scalerProfileSettingInfo) (at ./Library/PackageCache/com.unity.adaptiveperformance@5.1.0/Editor/Management/ProviderSettingsEditor.cs:479)
UnityEditor.AdaptivePerformance.Editor.ProviderSettingsEditor.DrawElementCallback (UnityEngine.Rect rect, System.Int32 index, System.Boolean isactive, System.Boolean isfocused) (at ./Library/PackageCache/com.unity.adaptiveperformance@5.1.0/Editor/Management/ProviderSettingsEditor.cs:333)
UnityEditorInternal.ReorderableList.DoListElements (UnityEngine.Rect listRect, UnityEngine.Rect visibleRect) (at /Users/bokken/build/output/unity/unity/Editor/Mono/GUI/ReorderableList.cs:993)
UnityEditorInternal.ReorderableList.DoLayoutList () (at /Users/bokken/build/output/unity/unity/Editor/Mono/GUI/ReorderableList.cs:752)
UnityEditor.AdaptivePerformance.Editor.ProviderSettingsEditor.DisplayScalerSettings () (at ./Library/PackageCache/com.unity.adaptiveperformance@5.1.0/Editor/Management/ProviderSettingsEditor.cs:289)
UnityEditor.AdaptivePerformance.Editor.ProviderSettingsEditor.DisplayBaseRuntimeSettings () (at ./Library/PackageCache/com.unity.adaptiveperformance@5.1.0/Editor/Management/ProviderSettingsEditor.cs:250)
UnityEditor.AdaptivePerformance.Simulator.Editor.SimulatorProviderSettingsEditor.OnInspectorGUI () (at ./Library/PackageCache/com.unity.adaptiveperformance@5.1.0/Editor/Provider/SimulatorProviderSettingsEditor.cs:25)
UnityEditor.AdaptivePerformance.Editor.AdaptivePerformanceConfigurationProvider.OnGUI (System.String searchContext) (at ./Library/PackageCache/com.unity.adaptiveperformance@5.1.0/Editor/Management/AdaptivePerformanceConfigurationProvider.cs:80)
UnityEditor.SettingsWindow.DrawControls () (at /Users/bokken/build/output/unity/unity/Editor/Mono/Settings/SettingsWindow.cs:440)
UnityEditor.SettingsWindow.DrawSettingsPanel () (at /Users/bokken/build/output/unity/unity/Editor/Mono/Settings/SettingsWindow.cs:411)
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/bokken/build/output/unity/unity/ModuleOverrides/com.unity.ui/Core/IMGUIContainer.cs:376)
UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, UnityEngine.Matrix4x4 worldTransform, UnityEngine.Rect clippingRect, System.Action onGUIHandler, System.Boolean canAffectFocus) (at /Users/bokken/build/output/unity/unity/ModuleOverrides/com.unity.ui/Core/IMGUIContainer.cs:676)
UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, System.Action onGUIHandler, System.Boolean canAffectFocus) (at /Users/bokken/build/output/unity/unity/ModuleOverrides/com.unity.ui/Core/IMGUIContainer.cs:648)
UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, System.Boolean canAffectFocus) (at /Users/bokken/build/output/unity/unity/ModuleOverrides/com.unity.ui/Core/IMGUIContainer.cs:641)
UnityEngine.UIElements.IMGUIContainer.SendEventToIMGUIRaw (UnityEngine.UIElements.EventBase evt, System.Boolean canAffectFocus, System.Boolean verifyBounds) (at /Users/bokken/build/output/unity/unity/ModuleOverrides/com.unity.ui/Core/IMGUIContainer.cs:601)
UnityEngine.UIElements.IMGUIContainer.SendEventToIMGUI (UnityEngine.UIElements.EventBase evt, System.Boolean canAffectFocus, System.Boolean verifyBounds) (at /Users/bokken/build/output/unity/unity/ModuleOverrides/com.unity.ui/Core/IMGUIContainer.cs:590)
UnityEngine.UIElements.IMGUIContainer.ProcessEvent (UnityEngine.UIElements.EventBase evt) (at /Users/bokken/build/output/unity/unity/ModuleOverrides/com.unity.ui/Core/IMGUIContainer.cs:514)
UnityEngine.UIElements.CallbackEventHandler.HandleEvent (UnityEngine.UIElements.EventBase evt) (at /Users/bokken/build/output/unity/unity/ModuleOverrides/com.unity.ui/Core/Events/EventHandler.cs:267)
UnityEngine.UIElements.CallbackEventHandler.HandleEventAtCurrentTargetAndPhase (UnityEngine.UIElements.EventBase evt) (at /Users/bokken/build/output/unity/unity/ModuleOverrides/com.unity.ui/Core/Events/EventHandler.cs:189)
UnityEngine.UIElements.CallbackEventHandler.HandleEventAtTargetPhase (UnityEngine.UIElements.EventBase evt) (at /Users/bokken/build/output/unity/unity/ModuleOverrides/com.unity.ui/Core/Events/EventHandler.cs:173)
UnityEngine.UIElements.MouseCaptureDispatchingStrategy.DispatchEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at /Users/bokken/build/output/unity/unity/ModuleOverrides/com.unity.ui/Core/Events/MouseCaptureDispatchingStrategy.cs:88)
UnityEngine.UIElements.EventDispatcher.ApplyDispatchingStrategies (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel, System.Boolean imguiEventIsInitiallyUsed) (at /Users/bokken/build/output/unity/unity/ModuleOverrides/com.unity.ui/Core/EventDispatcher.cs:509)
UnityEngine.UIElements.EventDispatcher.ProcessEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at /Users/bokken/build/output/unity/unity/ModuleOverrides/com.unity.ui/Core/EventDispatcher.cs:444)
UnityEngine.UIElements.EventDispatcher.ProcessEventQueue () (at /Users/bokken/build/output/unity/unity/ModuleOverrides/com.unity.ui/Core/EventDispatcher.cs:395)
UnityEngine.UIElements.EventDispatcher.OpenGate () (at /Users/bokken/build/output/unity/unity/ModuleOverrides/com.unity.ui/Core/EventDispatcher.cs:348)
UnityEngine.UIElements.EventDispatcherGate.Dispose () (at /Users/bokken/build/output/unity/unity/ModuleOverrides/com.unity.ui/Core/EventDispatcher.cs:78)
UnityEngine.UIElements.EventDispatcher.ProcessEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at /Users/bokken/build/output/unity/unity/ModuleOverrides/com.unity.ui/Core/EventDispatcher.cs:500)
UnityEngine.UIElements.EventDispatcher.Dispatch (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel, UnityEngine.UIElements.DispatchMode dispatchMode) (at /Users/bokken/build/output/unity/unity/ModuleOverrides/com.unity.ui/Core/EventDispatcher.cs:244)
UnityEngine.UIElements.BaseVisualElementPanel.SendEvent (UnityEngine.UIElements.EventBase e, UnityEngine.UIElements.DispatchMode dispatchMode) (at /Users/bokken/build/output/unity/unity/ModuleOverrides/com.unity.ui/Core/Panel.cs:520)
UnityEngine.UIElements.UIElementsUtility.DoDispatch (UnityEngine.UIElements.BaseVisualElementPanel panel) (at /Users/bokken/build/output/unity/unity/ModuleOverrides/com.unity.ui/Core/UIElementsUtility.cs:477)
UnityEngine.UIElements.UIElementsUtility.UnityEngine.UIElements.IUIElementsUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr, System.Boolean& eventHandled) (at /Users/bokken/build/output/unity/unity/ModuleOverrides/com.unity.ui/Core/UIElementsUtility.cs:205)
UnityEngine.UIElements.UIEventRegistration.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) (at /Users/bokken/build/output/unity/unity/ModuleOverrides/com.unity.ui/Core/UIElementsUtility.cs:74)
UnityEngine.UIElements.UIEventRegistration+<>c.<.cctor>b__1_2 (System.Int32 i, System.IntPtr ptr) (at /Users/bokken/build/output/unity/unity/ModuleOverrides/com.unity.ui/Core/UIElementsUtility.cs:28)
UnityEngine.GUIUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr, System.Boolean& result) (at /Users/bokken/build/output/unity/unity/Modules/IMGUI/GUIUtility.cs:203)”

Comments (1)

  1. DublikuntGames

    Jul 28, 2024 17:48

    Same on URP but on HDRP all work correctly.

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.