Search Issue Tracker

Won't Fix

Votes

0

Found in [Package]

2.0.0a12

Issue ID

UVSB-916

Regression

No

KeyNotFoundException appears when adding a switch on enum

Package: Visual Scripting Bugs

-

KeyNotFoundException appears in the console when you add an enum to an enum switch. 

Steps to reproduce
* Create a new project using Bolt 2.0.0.a12 and Unity 2019.4.1f1
* In the Assets, palette add a new Bolt Class
* Create an empty game object in the Hierarchy
* In the Inspector attach your Bolt class via the inspector. (Add Component, Bolt component)
* In the Asset palette right click and create a Bolt enum (Right Click > Create > Bolt > Enum)
* Fill it with a few elements via the inspector
* Open the Bolt class in the graph view.
* Add a switch on enum node attach it to the Start node.
* In the Switch node type dropdown, add the enum you create in the asset palette
* Notice issue >>  KeyNotFoundException: The given key was not present in the dictionary.

Notice issue >>  KeyNotFoundException: The given key was not present in the dictionary.
{code:java}
KeyNotFoundException: The given key was not present in the dictionary.
System.Collections.Generic.Dictionary`2[TKey,TValue].get_Item (TKey key) (at <fb001e01371b4adca20013e0ac763896>:0)
Unity.Bolt.UnitWidget`1[TUnit].DrawSetting (Unity.Bolt.Inspector settingInspector) (at Assets/Bolt/Bolt.Flow/Editor/Units/UnitWidget.cs:1243)
Unity.Bolt.UnitWidget`1[TUnit].DrawSettings () (at Assets/Bolt/Bolt.Flow/Editor/Units/UnitWidget.cs:1228)
Unity.Bolt.UnitWidget`1[TUnit].DrawForeground () (at Assets/Bolt/Bolt.Flow/Editor/Units/UnitWidget.cs:1178)
Unity.Bolt.Canvas.DrawWidgetsForeground () (at Assets/Bolt/Bolt.Core/Editor/Canvases/Canvas.cs:1882)
Unity.Bolt.Canvas.OnGUI () (at Assets/Bolt/Bolt.Core/Editor/Canvases/Canvas.cs:299)
Unity.Bolt.GraphWindow._OnGUI () (at Assets/Bolt/Bolt.Core/Editor/Windows/GraphWindow.cs:693)
Unity.Bolt.BoltEditorWindow.OnGUI () (at Assets/Bolt/Bolt.Core/Editor/Windows/BoltEditorWindow.cs:141)
System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <fb001e01371b4adca20013e0ac763896>:0)
Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <fb001e01371b4adca20013e0ac763896>:0)
System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at <fb001e01371b4adca20013e0ac763896>:0)
UnityEditor.HostView.Invoke (System.String methodName, System.Object obj) (at <fd8fd784002f49beab0500d3a24213b9>:0)
UnityEditor.HostView.Invoke (System.String methodName) (at <fd8fd784002f49beab0500d3a24213b9>:0)
UnityEditor.HostView.InvokeOnGUI (UnityEngine.Rect onGUIPosition, UnityEngine.Rect viewRect) (at <fd8fd784002f49beab0500d3a24213b9>:0)
UnityEditor.DockArea.DrawView (UnityEngine.Rect viewRect, UnityEngine.Rect dockAreaRect) (at <fd8fd784002f49beab0500d3a24213b9>:0)
UnityEditor.DockArea.OldOnGUI () (at <fd8fd784002f49beab0500d3a24213b9>:0)
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 <78b213560771414e9fa6f1b95f5ad8bb>:0)
UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, UnityEngine.Matrix4x4 worldTransform, UnityEngine.Rect clippingRect, System.Action onGUIHandler, System.Boolean canAffectFocus) (at <78b213560771414e9fa6f1b95f5ad8bb>:0)
UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, System.Action onGUIHandler, System.Boolean canAffectFocus) (at <78b213560771414e9fa6f1b95f5ad8bb>:0)
UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, System.Boolean canAffectFocus) (at <78b213560771414e9fa6f1b95f5ad8bb>:0)
UnityEngine.UIElements.IMGUIContainer.SendEventToIMGUI (UnityEngine.UIElements.EventBase evt, System.Boolean canAffectFocus) (at <78b213560771414e9fa6f1b95f5ad8bb>:0)
UnityEngine.UIElements.IMGUIContainer.HandleEvent (UnityEngine.UIElements.EventBase evt) (at <78b213560771414e9fa6f1b95f5ad8bb>:0)
UnityEngine.UIElements.EventDispatchUtilities.PropagateEvent (UnityEngine.UIElements.EventBase evt) (at <78b213560771414e9fa6f1b95f5ad8bb>:0)
UnityEngine.UIElements.MouseEventDispatchingStrategy.DispatchEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at <78b213560771414e9fa6f1b95f5ad8bb>:0)
UnityEngine.UIElements.EventDispatcher.ApplyDispatchingStrategies (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel, System.Boolean imguiEventIsInitiallyUsed) (at <78b213560771414e9fa6f1b95f5ad8bb>:0)
UnityEngine.UIElements.EventDispatcher.ProcessEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at <78b213560771414e9fa6f1b95f5ad8bb>:0)
UnityEngine.UIElements.EventDispatcher.ProcessEventQueue () (at <78b213560771414e9fa6f1b95f5ad8bb>:0)
UnityEngine.UIElements.EventDispatcher.OpenGate () (at <78b213560771414e9fa6f1b95f5ad8bb>:0)
UnityEngine.UIElements.EventDispatcherGate.Dispose () (at <78b213560771414e9fa6f1b95f5ad8bb>:0)
UnityEngine.UIElements.EventDispatcher.ProcessEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at <78b213560771414e9fa6f1b95f5ad8bb>:0)
UnityEngine.UIElements.EventDispatcher.Dispatch (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel, UnityEngine.UIElements.DispatchMode dispatchMode) (at <78b213560771414e9fa6f1b95f5ad8bb>:0)
UnityEngine.UIElements.BaseVisualElementPanel.SendEvent (UnityEngine.UIElements.EventBase e, UnityEngine.UIElements.DispatchMode dispatchMode) (at <78b213560771414e9fa6f1b95f5ad8bb>:0)
UnityEngine.UIElements.UIElementsUtility.DoDispatch (UnityEngine.UIElements.BaseVisualElementPanel panel) (at <78b213560771414e9fa6f1b95f5ad8bb>:0)
UnityEngine.UIElements.UIElementsUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) (at <78b213560771414e9fa6f1b95f5ad8bb>:0)
UnityEngine.GUIUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) (at <819de1aa368e45faa4f78e26c97c62b0>:0){code}
!image-2020-07-17-11-14-34-399.png!

Tested Broken
* Unity 2019.4.1f1
* Bolt [fix/54-switch-on-enum|https://github.cds.internal.unity3d.com/unity/com.unity.bolt/tree/fix/54-switch-on-enum] [,|https://github.cds.internal.unity3d.com/unity/com.unity.bolt/tree/fix/54-switch-on-enum] 2.0.0a12

  1. Resolution Note:

    Bolt 2 will not be released as its own product. See https://forum.unity.com/threads/visual-scripting-roadmap-update-august-2020.951675/ for details.

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.