Search Unity

Bug Editor UI exception

Discussion in 'Linux Editor' started by Joseph-Ferano, Aug 25, 2017.

  1. Joseph-Ferano

    Joseph-Ferano

    Joined:
    Jul 18, 2008
    Posts:
    165
    I contacted the vendor and they suggested it's more than likely a Unity editor issue. I'm on Ubuntu 17.04 zesty and Unity2017.1.0xf3Linux. Happened while I was installing the new Bolt visual scripting package from the asset store.

    Code (csharp):
    1. NullReferenceException: Object reference not set to an instance of an object
    2. UnityEngine.GUILayout.FlexibleSpace () (at /home/builduser/buildslave/unity/build/Runtime/IMGUI/Managed/GUILayout.cs:262)
    3. Ludiq.GeneratePropertyProvidersPage.OnContentGUI
    4. () (at C:/Users/Lazlo/Projects/Ludiq/Ludiq.Core/Editor/Windows/GeneratePropertyProvidersWindow/GeneratePropertyProvidersPage.cs:52)
    5. Ludiq.Page.DrawContent () (at C:/Users/Lazlo/Projects/Ludiq/Ludiq.Core/Editor/Windows/Page.cs:56)
    6. Ludiq.Wizard.OnGUI () (at C:/Users/Lazlo/Projects/Ludiq/Ludiq.Core/Editor/Windows/Wizard.cs:103)
    7. Ludiq.WrappedEditorWindow.OnGUI () (at C:/Users/Lazlo/Projects/Ludiq/Ludiq.Core/Editor/Windows/WrappedEditorWindow.cs:41)
    8. System.Reflection.MonoMethod.Invoke
    9. (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder
    10. binder, System.Object[] parameters, System.Globalization.CultureInfo
    11. culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)
    12. Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
    13. System.Reflection.MonoMethod.Invoke
    14. (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder
    15. binder, System.Object[] parameters, System.Globalization.CultureInfo
    16. culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:232)
    17. System.Reflection.MethodBase.Invoke
    18. (System.Object obj, System.Object[] parameters) (at
    19. /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MethodBase.cs:115)
    20. UnityEditor.HostView.Invoke
    21. (System.String methodName, System.Object obj) (at
    22. /home/builduser/buildslave/unity/build/Editor/Mono/HostView.cs:272)
    23. UnityEditor.HostView.Invoke (System.String methodName) (at /home/builduser/buildslave/unity/build/Editor/Mono/HostView.cs:265)
    24. UnityEditor.HostView.OnGUI () (at /home/builduser/buildslave/unity/build/Editor/Mono/HostView.cs:94)
     
  2. Joseph-Ferano

    Joseph-Ferano

    Joined:
    Jul 18, 2008
    Posts:
    165
    Here's another error I keep getting

    I got it from one piece of code that was renaming a ScriptableObject's name in the OnGUI method, I believe. Now I have no idea why I'm getting it.
     
  3. Joseph-Ferano

    Joseph-Ferano

    Joined:
    Jul 18, 2008
    Posts:
    165
    Actually, it's a little bit worse than I thought, the Inspector doesn't want to redraw
     
  4. Ludiq

    Ludiq

    Joined:
    Mar 6, 2015
    Posts:
    577
    Author of Bolt here!

    None of my Windows or Mac users reported the issue. The null ref exception occurs from within FlexibleSpace(), which makes me think it's not anything related to my code.
     
  5. Joseph-Ferano

    Joseph-Ferano

    Joined:
    Jul 18, 2008
    Posts:
    165
    Another issue I'm running into is that Bolt's search box when creating a new node is not capturing keyboard focus. It's a UI element very similar to the "Add New Component" popup you get from the inspector. The search in the inspector works fine and captures keyboard focus, but not for Bolt's. I suspect this is a Unity issue as well.
     
  6. Ludiq

    Ludiq

    Joined:
    Mar 6, 2015
    Posts:
    577
    To be clear though, Bolt has its own code for the fuzzy finder, but much of the input handling for clicks and text is directly imported from the decompiled Unity source for the add component dialog.
     
  7. Joseph-Ferano

    Joseph-Ferano

    Joined:
    Jul 18, 2008
    Posts:
    165
    Interesting, I switched to another application on my desktop and the bolt node search box remained open on top of the application. (Switched to Firefox) And it remains usable!
     
  8. Joseph-Ferano

    Joseph-Ferano

    Joined:
    Jul 18, 2008
    Posts:
    165
    More exceptions. These happen when I try to create a new node, like I tried to click on the "Self" node in a Transition graph. It added the node, but still got this error;

    Code (CSharp):
    1. NullReferenceException: Object reference not set to an instance of an object
    2. Bolt.FlowCanvas.AddUnit (IUnit unit, Vector2 position) (at C:/Users/Lazlo/Projects/Ludiq/Bolt.Flow/Editor/FlowCanvas.cs:278)
    3. Bolt.FlowCanvas+<>c__DisplayClass14_0.<NewUnit>b__0 (System.Object option) (at C:/Users/Lazlo/Projects/Ludiq/Bolt.Flow/Editor/FlowCanvas.cs:317)
    4. Ludiq.LudiqGUI+<>c__DisplayClass46_0.<FuzzyDropdown>b__0 (IFuzzyOption option) (at C:/Users/Lazlo/Projects/Ludiq/Ludiq.Core/Editor/Interface/LudiqGUI.cs:836)
    5. Ludiq.FuzzyWindow.SelectChild (Ludiq.FuzzyOptionNode node) (at C:/Users/Lazlo/Projects/Ludiq/Ludiq.Core/Editor/Interface/Fuzzy/FuzzyWindow.cs:460)
    6. Ludiq.FuzzyWindow.OnOptionsGUI (Ludiq.FuzzyOptionNode parent, Single scrollViewHeight) (at C:/Users/Lazlo/Projects/Ludiq/Ludiq.Core/Editor/Interface/Fuzzy/FuzzyWindow.cs:947)
    7. Ludiq.FuzzyWindow.OnLevelGUI (Single anim, Ludiq.FuzzyOptionNode parent, Ludiq.FuzzyOptionNode grandParent) (at C:/Users/Lazlo/Projects/Ludiq/Ludiq.Core/Editor/Interface/Fuzzy/FuzzyWindow.cs:779)
    8. Ludiq.FuzzyWindow.OnGUI () (at C:/Users/Lazlo/Projects/Ludiq/Ludiq.Core/Editor/Interface/Fuzzy/FuzzyWindow.cs:665)
    9. System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)
    10. Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
    11. System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:232)
    12. System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MethodBase.cs:115)
    13. UnityEditor.HostView.Invoke (System.String methodName, System.Object obj) (at /home/builduser/buildslave/unity/build/Editor/Mono/HostView.cs:272)
    14. UnityEditor.HostView.Invoke (System.String methodName) (at /home/builduser/buildslave/unity/build/Editor/Mono/HostView.cs:265)
    15. UnityEditor.HostView.OnGUI () (at /home/builduser/buildslave/unity/build/Editor/Mono/HostView.cs:94)
    16.  
     
  9. Tak

    Tak

    Unity Technologies

    Joined:
    Mar 8, 2010
    Posts:
    950
    I can't reproduce the exceptions here - but for the "fuzzy finder" , the show mode for the popup window should be set to PopupMenuWithKeyboardFocus
     
  10. Joseph-Ferano

    Joseph-Ferano

    Joined:
    Jul 18, 2008
    Posts:
    165
    Thanks for taking a look. I believe ludiq is on vacation, hopefully he can check out the code when he gets back. Let me know if there's anything I can do to help you find the bug.
     
  11. alvaromagnum

    alvaromagnum

    Joined:
    Dec 3, 2017
    Posts:
    1
    Same problem here. After importing and set bolt to configure things automatically.

    NullReferenceException: Object reference not set to an instance of an object

    UnityEngine.GUILayout.FlexibleSpace

    Using windows 10.

    Happened when unity was already open and tried to import Bolt into a 3d project, after generation of inspectors. Not reproduced when adding Bolt during a creation of a project in a 2d project.
     
    Last edited: Jan 12, 2018
  12. Ludiq

    Ludiq

    Joined:
    Mar 6, 2015
    Posts:
    577
    Hi Tak!
    I used a bit of reflection to have access to the overload that allows a mode and the ShowMode enum type.
    What's the difference with this mode exactly?

    Also, the flexible space issue has been reported & fixed here:
    https://forum.unity.com/threads/mac...ions-after-os-dialogs-have-been-shown.515421/
     
  13. Tak

    Tak

    Unity Technologies

    Joined:
    Mar 8, 2010
    Posts:
    950
    The difference is whether the OS should allow the popup to receive keyboard focus.
    On windows and mac, there's no difference between this mode and Popup, because all windows can receive keyboard focus.
    On linux, if you allow all popups to have keyboard focus, then it can give users very strange behavior in terms of window management and focus. Unfortunately, we have no way to autodetect in advance whether a popup should be able to receive keyboard focus...
     
  14. Ludiq

    Ludiq

    Joined:
    Mar 6, 2015
    Posts:
    577
    I see! Thanks for the explanation. In that case, you should probably consider making the overload to determine the popup mode public, or at least provide a boolean overload to specify that.
     
  15. MAVG

    MAVG

    Joined:
    Feb 22, 2018
    Posts:
    7
    i also have an error similar to that one it doesn´t let me setup bolt in 4x NET :(

    NullReferenceException: Object reference not set to an instance of an object
    Ludiq.GenerateDocumentationPage.OnContentGUI () (at C:/Users/lazlo/Projects/Bolt1/Package/Ludiq.Core/Editor/Windows/GenerateDocumentationWindow/GenerateDocumentationPage.cs:107)
    Ludiq.Page.DrawContent () (at C:/Users/lazlo/Projects/Bolt1/Package/Ludiq.Core/Editor/Windows/Page.cs:70)
    Ludiq.Wizard.OnGUI () (at C:/Users/lazlo/Projects/Bolt1/Package/Ludiq.Core/Editor/Windows/Wizard.cs:106)
    Ludiq.WrappedEditorWindow.OnGUI () (at C:/Users/lazlo/Projects/Bolt1/Package/Ludiq.Core/Editor/Windows/WrappedEditorWindow.cs:51)
    System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <1f0c1ef1ad524c38bbc5536809c46b48>: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 <1f0c1ef1ad524c38bbc5536809c46b48>:0)
    System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at <1f0c1ef1ad524c38bbc5536809c46b48>:0)
    UnityEditor.HostView.Invoke (System.String methodName, System.Object obj) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:345)
    UnityEditor.HostView.Invoke (System.String methodName) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:339)
    UnityEditor.HostView.OldOnGUI () (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:139)
    UnityEngine.UIElements.IMGUIContainer.DoOnGUI (UnityEngine.Event evt, UnityEngine.Matrix4x4 parentTransform, UnityEngine.Rect clippingRect, System.Boolean isComputingLayout, UnityEngine.Rect layoutSize) (at C:/buildslave/unity/build/Modules/UIElements/IMGUIContainer.cs:278)
    UnityEngine.GUIUtility: ProcessEvent(Int32, IntPtr)