NullReferenceException in OnGUI

Discussion and help for Easy Save 3
Post Reply
lpacphantom
Posts: 2
Joined: Thu Jul 27, 2023 3:41 pm

NullReferenceException in OnGUI

Post by lpacphantom »

I'm trying to enable auto saving, but when I open the auto save settings window, I get repeated NullReferenceExceptions and ArgumentExceptions and can't see anything under the Scenes or Prefabs tabs like I see in the guide page. I'm using 2022.3.0f1, just purchased ES3 yesterday, so should be latest version.

Code: Select all

NullReferenceException: Object reference not set to an instance of an object
UnityEngine.GUILayoutUtility.DoGetRect (UnityEngine.GUIContent content, UnityEngine.GUIStyle style, UnityEngine.GUILayoutOption[] options) (at <cbf2a10624ce43bd854be663c98dfa0e>:0)
UnityEngine.GUILayoutUtility.GetRect (UnityEngine.GUIContent content, UnityEngine.GUIStyle style, UnityEngine.GUILayoutOption[] options) (at <cbf2a10624ce43bd854be663c98dfa0e>:0)
UnityEngine.GUILayout.DoTextField (System.String text, System.Int32 maxLength, System.Boolean multiline, UnityEngine.GUIStyle style, UnityEngine.GUILayoutOption[] options) (at <cbf2a10624ce43bd854be663c98dfa0e>:0)
UnityEngine.GUILayout.TextField (System.String text, UnityEngine.GUIStyle style, UnityEngine.GUILayoutOption[] options) (at <cbf2a10624ce43bd854be663c98dfa0e>:0)
ES3Editor.AutoSaveWindow.OnGUI () (at Assets/Plugins/Easy Save 3/Editor/AutoSaveWindow.cs:103)
ES3Editor.ES3Window.OnGUI () (at Assets/Plugins/Easy Save 3/Editor/ES3Window.cs:180)
UnityEditor.HostView.InvokeOnGUI (UnityEngine.Rect onGUIPosition) (at <4911eca47f294e18a7b3306f02701303>:0)
UnityEditor.DockArea.DrawView (UnityEngine.Rect dockAreaRect) (at <4911eca47f294e18a7b3306f02701303>:0)
UnityEditor.DockArea.OldOnGUI () (at <4911eca47f294e18a7b3306f02701303>: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 <73c3b9fa4da644c9a21a8a16d8e2909f>:0)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)

Code: Select all

ArgumentException: Getting control 0's position in a group with only 0 controls when doing repaint
Aborting
UnityEngine.GUILayoutGroup.GetNext () (at <cbf2a10624ce43bd854be663c98dfa0e>:0)
UnityEngine.GUILayoutUtility.DoGetRect (UnityEngine.GUIContent content, UnityEngine.GUIStyle style, UnityEngine.GUILayoutOption[] options) (at <cbf2a10624ce43bd854be663c98dfa0e>:0)
UnityEngine.GUILayoutUtility.GetRect (UnityEngine.GUIContent content, UnityEngine.GUIStyle style, UnityEngine.GUILayoutOption[] options) (at <cbf2a10624ce43bd854be663c98dfa0e>:0)
UnityEngine.GUILayout.DoTextField (System.String text, System.Int32 maxLength, System.Boolean multiline, UnityEngine.GUIStyle style, UnityEngine.GUILayoutOption[] options) (at <cbf2a10624ce43bd854be663c98dfa0e>:0)
UnityEngine.GUILayout.TextField (System.String text, UnityEngine.GUIStyle style, UnityEngine.GUILayoutOption[] options) (at <cbf2a10624ce43bd854be663c98dfa0e>:0)
ES3Editor.AutoSaveWindow.OnGUI () (at Assets/Plugins/Easy Save 3/Editor/AutoSaveWindow.cs:103)
ES3Editor.ES3Window.OnGUI () (at Assets/Plugins/Easy Save 3/Editor/ES3Window.cs:180)
UnityEditor.HostView.InvokeOnGUI (UnityEngine.Rect onGUIPosition) (at <4911eca47f294e18a7b3306f02701303>:0)
UnityEditor.DockArea.DrawView (UnityEngine.Rect dockAreaRect) (at <4911eca47f294e18a7b3306f02701303>:0)
UnityEditor.DockArea.OldOnGUI () (at <4911eca47f294e18a7b3306f02701303>: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 <73c3b9fa4da644c9a21a8a16d8e2909f>:0)
UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, UnityEngine.Matrix4x4 worldTransform, UnityEngine.Rect clippingRect, System.Action onGUIHandler, System.Boolean canAffectFocus) (at <73c3b9fa4da644c9a21a8a16d8e2909f>:0)
UnityEngine.UIElements.IMGUIContainer.DoIMGUIRepaint () (at <73c3b9fa4da644c9a21a8a16d8e2909f>:0)
UnityEngine.UIElements.UIR.RenderChainCommand.ExecuteNonDrawMesh (UnityEngine.UIElements.UIR.DrawParams drawParams, System.Single pixelsPerPoint, System.Exception& immediateException) (at <73c3b9fa4da644c9a21a8a16d8e2909f>:0)
Rethrow as ImmediateModeException
UnityEngine.UIElements.UIR.RenderChain.Render () (at <73c3b9fa4da644c9a21a8a16d8e2909f>:0)
UnityEngine.UIElements.UIRRepaintUpdater.Update () (at <73c3b9fa4da644c9a21a8a16d8e2909f>:0)
UnityEngine.UIElements.VisualTreeUpdater.UpdateVisualTreePhase (UnityEngine.UIElements.VisualTreeUpdatePhase phase) (at <73c3b9fa4da644c9a21a8a16d8e2909f>:0)
UnityEngine.UIElements.Panel.UpdateForRepaint () (at <73c3b9fa4da644c9a21a8a16d8e2909f>:0)
UnityEngine.UIElements.Panel.Repaint (UnityEngine.Event e) (at <73c3b9fa4da644c9a21a8a16d8e2909f>:0)
UnityEngine.UIElements.UIElementsUtility.DoDispatch (UnityEngine.UIElements.BaseVisualElementPanel panel) (at <73c3b9fa4da644c9a21a8a16d8e2909f>:0)
UnityEngine.UIElements.UIElementsUtility.UnityEngine.UIElements.IUIElementsUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr, System.Boolean& eventHandled) (at <73c3b9fa4da644c9a21a8a16d8e2909f>:0)
UnityEngine.UIElements.UIEventRegistration.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) (at <73c3b9fa4da644c9a21a8a16d8e2909f>:0)
UnityEngine.UIElements.UIEventRegistration+<>c.<.cctor>b__1_2 (System.Int32 i, System.IntPtr ptr) (at <73c3b9fa4da644c9a21a8a16d8e2909f>:0)
UnityEngine.GUIUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr, System.Boolean& result) (at <cbf2a10624ce43bd854be663c98dfa0e>:0)
User avatar
Joel
Moodkie Staff
Posts: 4849
Joined: Wed Nov 07, 2012 10:32 pm

Re: NullReferenceException in OnGUI

Post by Joel »

Hi there, and thanks for getting in contact.

I've had no reports of this issue and it appears to be working fine in 2022.3.5f1, so I first recommend updating to the latest version of 2022.3 in case this is a bug at Unity's end.

If this doesn't resolve the issue please could you replicate this in a new project and private message it to me so I can see what is happening.

All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
lpacphantom
Posts: 2
Joined: Thu Jul 27, 2023 3:41 pm

Re: NullReferenceException in OnGUI

Post by lpacphantom »

Upgrading to 2022.3.5 worked.
User avatar
Joel
Moodkie Staff
Posts: 4849
Joined: Wed Nov 07, 2012 10:32 pm

Re: NullReferenceException in OnGUI

Post by Joel »

Glad to hear it, let me know if you run into any other issues.

All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
Post Reply