github-for-unity / Unity

GitHub for Unity
https://unity.github.com/
MIT License
3.02k stars 448 forks source link

Nullreference exception error avalanche on drawing UI on branch change #1128

Closed SaulNunez closed 1 year ago

SaulNunez commented 3 years ago

Prerequisites

github-unity.log

Description

Null reference exception everytime I switch branches using Github for Unity.

Steps to Reproduce

  1. Go to Branches
  2. Double click a branch to make it current
  3. Open Unity console to see error

Expected behavior: [What you expect to happen] To be able to change branches without problem.

Actual behavior: [What actually happens] On changin branches something get assigned to null. Showing errors and making the Github panel broken as you can't do commits for example.

Reproduces how often: [What percentage of the time does it reproduce?] Always on branch change.

Additional Information

Any additional information, configuration or data that might be necessary to reproduce the issue.

Exception: Style.Draw may not be called with GUIContent that is null.
UnityEngine.GUIStyle.Draw (UnityEngine.Rect position, UnityEngine.GUIContent content, System.Int32 controlId, System.Boolean isHover, System.Boolean isActive, System.Boolean on, System.Boolean hasKeyboardFocus) (at <819de1aa368e45faa4f78e26c97c62b0>:0)
UnityEngine.GUIStyle.Draw (UnityEngine.Rect position, UnityEngine.GUIContent content, System.Boolean isHover, System.Boolean isActive, System.Boolean on, System.Boolean hasKeyboardFocus) (at <819de1aa368e45faa4f78e26c97c62b0>:0)
GitHub.Unity.TreeNode.Render (UnityEngine.Rect rect, System.Single indentation, System.Boolean isSelected, System.Boolean treeIsBusy, UnityEngine.GUIStyle toggleStyle, UnityEngine.GUIStyle nodeStyle, UnityEngine.GUIStyle activeNodeStyle) (at C:/projects/unity/src/UnityExtension/Assets/Editor/GitHub.Unity/UI/TreeControl.cs:519)
GitHub.Unity.Tree`2[TNode,TData].Render (UnityEngine.Rect treeDisplayRect, UnityEngine.Vector2 scroll, System.Action`1[T] singleClick, System.Action`1[T] doubleClick, System.Action`1[T] rightClick) (at C:/projects/unity/src/UnityExtension/Assets/Editor/GitHub.Unity/UI/TreeControl.cs:79)
GitHub.Unity.BranchesView.OnTreeGUI (UnityEngine.Rect rect) (at C:/projects/unity/src/UnityExtension/Assets/Editor/GitHub.Unity/UI/BranchesView.cs:369)
GitHub.Unity.BranchesView.Render () (at C:/projects/unity/src/UnityExtension/Assets/Editor/GitHub.Unity/UI/BranchesView.cs:211)
GitHub.Unity.BranchesView.OnGUI () (at C:/projects/unity/src/UnityExtension/Assets/Editor/GitHub.Unity/UI/BranchesView.cs:178)
GitHub.Unity.Window.DoActiveViewGUI () (at C:/projects/unity/src/UnityExtension/Assets/Editor/GitHub.Unity/UI/Window.cs:723)
GitHub.Unity.Window.OnUI () (at C:/projects/unity/src/UnityExtension/Assets/Editor/GitHub.Unity/UI/Window.cs:504)
GitHub.Unity.BaseWindow.OnGUI () (at C:/projects/unity/src/UnityExtension/Assets/Editor/GitHub.Unity/UI/BaseWindow.cs:93)
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 <d7545a46516941d4b2f2dec578cd41ee>:0)
UnityEditor.HostView.Invoke (System.String methodName) (at <d7545a46516941d4b2f2dec578cd41ee>:0)
UnityEditor.HostView.InvokeOnGUI (UnityEngine.Rect onGUIPosition, UnityEngine.Rect viewRect) (at <d7545a46516941d4b2f2dec578cd41ee>:0)
UnityEditor.DockArea.DrawView (UnityEngine.Rect viewRect, UnityEngine.Rect dockAreaRect) (at <d7545a46516941d4b2f2dec578cd41ee>:0)
UnityEditor.DockArea.OldOnGUI () (at <d7545a46516941d4b2f2dec578cd41ee>: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 <a9183b39766a483caf86aaa926f3554c>:0)
UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, UnityEngine.Matrix4x4 worldTransform, UnityEngine.Rect clippingRect, System.Action onGUIHandler, System.Boolean canAffectFocus) (at <a9183b39766a483caf86aaa926f3554c>:0)
UnityEngine.UIElements.IMGUIContainer.DoIMGUIRepaint () (at <a9183b39766a483caf86aaa926f3554c>:0)
UnityEngine.UIElements.UIR.RenderChainCommand.ExecuteNonDrawMesh (UnityEngine.UIElements.UIR.DrawParams drawParams, System.Boolean straightY, System.Single pixelsPerPoint, System.Exception& immediateException) (at <a9183b39766a483caf86aaa926f3554c>:0)
Rethrow as ImmediateModeException
UnityEngine.UIElements.UIR.RenderChain.Render (UnityEngine.Rect viewport, UnityEngine.Matrix4x4 projection, UnityEngine.UIElements.PanelClearFlags clearFlags) (at <a9183b39766a483caf86aaa926f3554c>:0)
UnityEngine.UIElements.UIRRepaintUpdater.DrawChain (UnityEngine.Rect viewport, UnityEngine.Matrix4x4 projection) (at <a9183b39766a483caf86aaa926f3554c>:0)
UnityEngine.UIElements.UIRRepaintUpdater.Update () (at <a9183b39766a483caf86aaa926f3554c>:0)
UnityEngine.UIElements.VisualTreeUpdater.UpdateVisualTreePhase (UnityEngine.UIElements.VisualTreeUpdatePhase phase) (at <a9183b39766a483caf86aaa926f3554c>:0)
UnityEngine.UIElements.Panel.UpdateForRepaint () (at <a9183b39766a483caf86aaa926f3554c>:0)
UnityEngine.UIElements.Panel.Repaint (UnityEngine.Event e) (at <a9183b39766a483caf86aaa926f3554c>:0)
UnityEngine.UIElements.UIElementsUtility.DoDispatch (UnityEngine.UIElements.BaseVisualElementPanel panel) (at <a9183b39766a483caf86aaa926f3554c>:0)
UnityEngine.UIElements.UIElementsUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) (at <a9183b39766a483caf86aaa926f3554c>:0)
UnityEngine.GUIUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) (at <819de1aa368e45faa4f78e26c97c62b0>:0)
goldendk commented 3 years ago

Would just like to echo that this is happening to me as well. Would be nice with a fix as they Unity Collaborate doesn't really meet my needs. But a great asset you have built so far.