Search Issue Tracker

Active

Under Consideration for 1.0.X

Votes

0

Found in [Package]

1.0.6

Issue ID

BEHAVB-129

Regression

No

[Error] Duplicating conditional branch and setting the condition throws a null reference error

Package: Unity Behavior

-

*Steps to reproduce:*
# Create and open an empty project
# Install com.unity.behavior
# Create and open a behavior graph (Assets > Create > Behavior > Behavior Graph)
# Right-click on an empty area and select Add...
# Add a Conditional Branch
# In the graph inspector, press Assign Condition and assign it to Check Distance
# Duplicate the branch node (Right-click > Duplicate)
# Set the dropdown of the condition to anything other than Equal

*Actual results:* A null reference error is thrown and if you focus out and back the duplicated conditional node is behind instead of in the front

*Expected results:* No error is thrown and the duplicated conditional node stays in front when focusing out and back

*Reproducible with versions:*
1.0.6

*Can’t test with versions:*
1.0.0 (there was another issue in this version where you can't change the dropdown at all)

*Tested on (OS):* MacOS (M1) 15.1.1

*Stack trace*
{code:java}
NullReferenceException: Object reference not set to an instance of an object
Unity.Behavior.ComparisonConditionElement+<>c__DisplayClass10_0.<SetupDropdownElement>b__1 (UnityEngine.UIElements.ChangeEvent`1[T] evt) (at ./Library/PackageCache/com.unity.behavior/Authoring/UI/AssetEditor/Nodes/ComparisonConditionElement.cs:154)
UnityEngine.UIElements.EventCallbackFunctor`1[TEventType].Invoke (UnityEngine.UIElements.EventBase evt) (at /Users/bokken/build/output/unity/unity/Modules/UIElements/Core/Events/EventCallback.cs:64)
UnityEngine.UIElements.EventCallbackRegistry+DynamicCallbackList.Invoke (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.BaseVisualElementPanel panel, UnityEngine.UIElements.VisualElement target) (at /Users/bokken/build/output/unity/unity/Modules/UIElements/Core/Events/EventCallbackRegistry.cs:228)
UnityEngine.UIElements.EventDispatchUtilities.HandleEvent_BubbleUpCallbacks (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.BaseVisualElementPanel panel, UnityEngine.UIElements.VisualElement element) (at /Users/bokken/build/output/unity/unity/Modules/UIElements/Core/Events/EventDispatchUtilities.cs:385)
UnityEngine.UIElements.EventDispatchUtilities.HandleEventAcrossPropagationPath (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.BaseVisualElementPanel panel, UnityEngine.UIElements.VisualElement target, System.Boolean isCapturingTarget) (at /Users/bokken/build/output/unity/unity/Modules/UIElements/Core/Events/EventDispatchUtilities.cs:183)
UnityEngine.UIElements.EventDispatchUtilities.PropagateEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.BaseVisualElementPanel panel, UnityEngine.UIElements.VisualElement target, System.Boolean isCapturingTarget) (at /Users/bokken/build/output/unity/unity/Modules/UIElements/Core/Events/EventDispatchUtilities.cs:61)
UnityEngine.UIElements.EventDispatchUtilities.DefaultDispatch (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.BaseVisualElementPanel panel) (at /Users/bokken/build/output/unity/unity/Modules/UIElements/Core/Events/EventDispatchUtilities.cs:564)
UnityEngine.UIElements.EventBase.Dispatch (UnityEngine.UIElements.BaseVisualElementPanel panel) (at /Users/bokken/build/output/unity/unity/Modules/UIElements/Core/Events/EventBase.cs:110)
UnityEngine.UIElements.EventDispatcher.ProcessEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.BaseVisualElementPanel panel) (at /Users/bokken/build/output/unity/unity/Modules/UIElements/Core/EventDispatcher.cs:415)
UnityEngine.UIElements.EventDispatcher.ProcessEventQueue () (at /Users/bokken/build/output/unity/unity/Modules/UIElements/Core/EventDispatcher.cs:365)
UnityEngine.UIElements.EventDispatcher.OpenGate () (at /Users/bokken/build/output/unity/unity/Modules/UIElements/Core/EventDispatcher.cs:318)
UnityEngine.UIElements.EventDispatcherGate.Dispose () (at /Users/bokken/build/output/unity/unity/Modules/UIElements/Core/EventDispatcher.cs:79)
UnityEngine.UIElements.EventDispatcher.ProcessEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.BaseVisualElementPanel panel) (at /Users/bokken/build/output/unity/unity/Modules/UIElements/Core/EventDispatcher.cs:429)
UnityEngine.UIElements.EventDispatcher.Dispatch (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.BaseVisualElementPanel panel, UnityEngine.UIElements.DispatchMode dispatchMode) (at /Users/bokken/build/output/unity/unity/Modules/UIElements/Core/EventDispatcher.cs:215)
UnityEngine.UIElements.BaseVisualElementPanel.SendEvent (UnityEngine.UIElements.EventBase e, UnityEngine.UIElements.DispatchMode dispatchMode) (at /Users/bokken/build/output/unity/unity/Modules/UIElements/Core/Panel.cs:590)
UnityEngine.UIElements.UIElementsUtility.DoDispatch (UnityEngine.UIElements.BaseVisualElementPanel panel) (at /Users/bokken/build/output/unity/unity/Modules/UIElements/Core/UIElementsUtility.cs:513)
UnityEngine.UIElements.UIElementsUtility.UnityEngine.UIElements.IUIElementsUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr, System.Boolean& eventHandled) (at /Users/bokken/build/output/unity/unity/Modules/UIElements/Core/UIElementsUtility.cs:232)
UnityEngine.UIElements.UIEventRegistration.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) (at /Users/bokken/build/output/unity/unity/Modules/UIElements/Core/UIElementsUtility.cs:76)
UnityEngine.UIElements.UIEventRegistration+<>c.<.cctor>b__1_2 (System.Int32 i, System.IntPtr ptr) (at /Users/bokken/build/output/unity/unity/Modules/UIElements/Core/UIElementsUtility.cs:30)
UnityEngine.GUIUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr, System.Boolean& result) (at /Users/bokken/build/output/unity/unity/Modules/IMGUI/GUIUtility.cs:219)
{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.