0
Fixed

Peek fails on script recompile

rava 2 months ago updated by Lazlo Bonin (Lead Developer) 2 months ago 2

Issue:

Opening Hierarchy Search [Ctrl+F] while Unity is recompiling scripts causes Peek to become unusable and throw errors until another recompile.

Steps to reproduce (Unity 2018 LTS):

1) Unfocus Unity and edit a script (using Visual Studio myself, unsure if that matters.)

2) Click back to Scene and immediately press [Ctrl+F]

3) Peek Search opens

4) Unity finishes recompiling

5) Peek starts throwing errors

- Whenever the search popup is reopened after recompile

- Whenever clicking on hover components in the Hierarchy

Manual fixes:

A) Edit a script again and let it successfully recompile without touching Peek.

B) Reopen Unity.

Errors (repeatedly) after Issue is reproduced:

Copied style is null. Using StyleNotFound instead.
UnityEngine.GUIStyle:.ctor(GUIStyle)
Ludiq.PeekCore.LudiqStyles:.cctor() (at Assets/Ludiq/Ludiq.PeekCore/Editor/Interface/LudiqStyles.cs:12)
System.Object:__icall_wrapper_mono_generic_class_init(IntPtr)
Ludiq.Peek.HierarchyPopup:Update() (at Assets/Ludiq/Ludiq.Peek/Editor/Hierarchies/HierarchyPopup.cs:61)
UnityEditor.EditorApplication:Internal_CallUpdateFunctions()

Unable to use a named GUIStyle without a current skin. Most likely you need to move your GUIStyle initialization code to OnGUI
UnityEngine.GUIStyle:op_Implicit(String)
Ludiq.PeekCore.LudiqStyles:.cctor() (at Assets/Ludiq/Ludiq.PeekCore/Editor/Interface/LudiqStyles.cs:34)
System.Object:__icall_wrapper_mono_generic_class_init(IntPtr)
Ludiq.Peek.HierarchyPopup:Update() (at Assets/Ludiq/Ludiq.Peek/Editor/Hierarchies/HierarchyPopup.cs:61)
UnityEditor.EditorApplication:Internal_CallUpdateFunctions()

NullReferenceException: Object reference not set to an instance of an object
Ludiq.PeekCore.LudiqStyles..cctor () (at Assets/Ludiq/Ludiq.PeekCore/Editor/Interface/LudiqStyles.cs:68)
Rethrow as TypeInitializationException: The type initializer for 'Ludiq.PeekCore.LudiqStyles' threw an exception.
Ludiq.Peek.HierarchyPopup.Update () (at Assets/Ludiq/Ludiq.Peek/Editor/Hierarchies/HierarchyPopup.cs:61)
Unity Version:
Peek Version:
Working on Fix

Hi Rava,

Thanks for the report and sorry about the issue.

The Hierarchy popup isn't meant to survive assembly reloads, which caused those errors.

In v.1.0.1, it will elegantly close after an assembly reload.