Page 1 of 1

Help with Null Reference Exception

Posted: Sun Jul 30, 2023 1:10 am
by Unrighteous
Hello, I just randomly started getting an error and I can't really figure out what caused it. It's very possible that it's something I did, but I'm not sure. It pops up a bunch when I view a conversation. It happens with any conversation, including conversations containing a single node.

Here's the error:

Code: Select all

NullReferenceException: Object reference not set to an instance of an object
PixelCrushers.DialogueSystem.DialogueEditor.DialogueEditorWindow.DrawConversationSectionNodeStyle () (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/Editor/Dialogue Editor/Nodes/DialogueEditorWindowConversationNodeEditor.cs:173)
PixelCrushers.DialogueSystem.DialogueEditor.DialogueEditorWindow.DrawConversationSection () (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/Editor/Dialogue Editor/DialogueEditorWindowConversationSection.cs:158)
PixelCrushers.DialogueSystem.DialogueEditor.DialogueEditorWindow.DrawCurrentSection () (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/Editor/Dialogue Editor/DialogueEditorWindowMain.cs:465)
PixelCrushers.DialogueSystem.DialogueEditor.DialogueEditorWindow.DrawMainBody () (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/Editor/Dialogue Editor/DialogueEditorWindowMain.cs:430)
PixelCrushers.DialogueSystem.DialogueEditor.DialogueEditorWindow.OnGUI () (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/Editor/Dialogue Editor/DialogueEditorWindowMain.cs:336)
UnityEditor.HostView.InvokeOnGUI (UnityEngine.Rect onGUIPosition, UnityEngine.Rect viewRect) (at <25578071f6e44201aac745680e5c8dfc>:0)
UnityEditor.DockArea.DrawView (UnityEngine.Rect viewRect, UnityEngine.Rect dockAreaRect) (at <25578071f6e44201aac745680e5c8dfc>:0)
UnityEditor.DockArea.OldOnGUI () (at <25578071f6e44201aac745680e5c8dfc>: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 <7b67ea7a31af4ddfa668bdaf9d8bf0c8>:0)
UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, UnityEngine.Matrix4x4 worldTransform, UnityEngine.Rect clippingRect, System.Action onGUIHandler, System.Boolean canAffectFocus) (at <7b67ea7a31af4ddfa668bdaf9d8bf0c8>:0)
UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, System.Action onGUIHandler, System.Boolean canAffectFocus) (at <7b67ea7a31af4ddfa668bdaf9d8bf0c8>:0)
UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, System.Boolean canAffectFocus) (at <7b67ea7a31af4ddfa668bdaf9d8bf0c8>:0)
UnityEngine.UIElements.IMGUIContainer.SendEventToIMGUIRaw (UnityEngine.UIElements.EventBase evt, System.Boolean canAffectFocus, System.Boolean verifyBounds) (at <7b67ea7a31af4ddfa668bdaf9d8bf0c8>:0)
UnityEngine.UIElements.IMGUIContainer.SendEventToIMGUI (UnityEngine.UIElements.EventBase evt, System.Boolean canAffectFocus, System.Boolean verifyBounds) (at <7b67ea7a31af4ddfa668bdaf9d8bf0c8>:0)
UnityEngine.UIElements.IMGUIContainer.HandleEvent (UnityEngine.UIElements.EventBase evt) (at <7b67ea7a31af4ddfa668bdaf9d8bf0c8>:0)
UnityEngine.UIElements.EventDispatchUtilities.PropagateEvent (UnityEngine.UIElements.EventBase evt) (at <7b67ea7a31af4ddfa668bdaf9d8bf0c8>:0)
UnityEngine.UIElements.MouseEventDispatchingStrategy.SendEventToRegularTarget (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.BaseVisualElementPanel panel) (at <7b67ea7a31af4ddfa668bdaf9d8bf0c8>:0)
UnityEngine.UIElements.MouseEventDispatchingStrategy.SendEventToTarget (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.BaseVisualElementPanel panel) (at <7b67ea7a31af4ddfa668bdaf9d8bf0c8>:0)
UnityEngine.UIElements.MouseEventDispatchingStrategy.DispatchEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel iPanel) (at <7b67ea7a31af4ddfa668bdaf9d8bf0c8>:0)
UnityEngine.UIElements.EventDispatcher.ApplyDispatchingStrategies (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel, System.Boolean imguiEventIsInitiallyUsed) (at <7b67ea7a31af4ddfa668bdaf9d8bf0c8>:0)
UnityEngine.UIElements.EventDispatcher.ProcessEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at <7b67ea7a31af4ddfa668bdaf9d8bf0c8>:0)
UnityEngine.UIElements.EventDispatcher.Dispatch (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel, UnityEngine.UIElements.DispatchMode dispatchMode) (at <7b67ea7a31af4ddfa668bdaf9d8bf0c8>:0)
UnityEngine.UIElements.BaseVisualElementPanel.SendEvent (UnityEngine.UIElements.EventBase e, UnityEngine.UIElements.DispatchMode dispatchMode) (at <7b67ea7a31af4ddfa668bdaf9d8bf0c8>:0)
UnityEngine.UIElements.UIElementsUtility.DoDispatch (UnityEngine.UIElements.BaseVisualElementPanel panel) (at <7b67ea7a31af4ddfa668bdaf9d8bf0c8>:0)
UnityEngine.UIElements.UIElementsUtility.UnityEngine.UIElements.IUIElementsUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr, System.Boolean& eventHandled) (at <7b67ea7a31af4ddfa668bdaf9d8bf0c8>:0)
UnityEngine.UIElements.UIEventRegistration.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) (at <7b67ea7a31af4ddfa668bdaf9d8bf0c8>:0)
UnityEngine.UIElements.UIEventRegistration+<>c.<.cctor>b__1_2 (System.Int32 i, System.IntPtr ptr) (at <7b67ea7a31af4ddfa668bdaf9d8bf0c8>:0)
UnityEngine.GUIUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr, System.Boolean& result) (at <af80b1f3b9084427acdb96add3d81979>:0)
Any help is greatly appreciated, thanks!

Re: Help with Null Reference Exception

Posted: Sun Jul 30, 2023 9:34 am
by Tony Li
Hi,

Recent Unity versions broke something in custom editor UIs. (They changed the name of a standard resource.) Please update to Dialogue System version 2.2.38.2 or newer to get the fix.

Re: Help with Null Reference Exception

Posted: Sun Jul 30, 2023 2:53 pm
by Unrighteous
Thanks! That fixed it.

I really should have checked for an update, but I thought I had done something to mess things up since the error only started popping up yesterday and the project is a few weeks old.

Thank you, I really appreciate the help!

Re: Help with Null Reference Exception

Posted: Sun Jul 30, 2023 3:20 pm
by Tony Li
Glad to help!