0
Not a Bug

Fuzzy finder broken after compiling custom unit

Eric Welwood 4 years ago updated by Lazlo Bonin (Lead Developer) 4 years ago 4

If I right click the fuzzy finder only displays the loading animation and 2 errors are logged.

ArgumentNullException: Value cannot be null.
Parameter name: element
Ludiq.EnsureThat.IsNotNull[MemberInfo] (System.Reflection.MemberInfo value) (at C:/Users/Lazlo/Projects/Ludiq/Ludiq.Core/Runtime/Ensure/EnsureThat.Objects.cs:16)
Ludiq.AttributeUtility.GetAttributeCache (System.Reflection.MemberInfo element) (at C:/Users/Lazlo/Projects/Ludiq/Ludiq.Core/Runtime/Reflection/AttributeUtility.cs:206)
Ludiq.AttributeUtility.HasAttribute[ObsoleteAttribute] (System.Reflection.MemberInfo element, Boolean inherit) (at C:/Users/Lazlo/Projects/Ludiq/Ludiq.Core/Runtime/Reflection/AttributeUtility.cs:285)
Bolt.UnitOptionFilter.ValidateOption (IUnitOption option) (at C:/Users/Lazlo/Projects/Ludiq/Bolt.Flow/Editor/Options/UnitOptionFilter.cs:272)
System.Linq.Enumerable+<CreateWhereIterator>c__Iterator1D`1[Bolt.IUnitOption].MoveNext ()
System.Collections.Generic.List`1[Bolt.IUnitOption].AddEnumerable (IEnumerable`1 enumerable) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Collections.Generic/List.cs:128)
System.Collections.Generic.List`1[Bolt.IUnitOption]..ctor (IEnumerable`1 collection) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Collections.Generic/List.cs:65)
System.Linq.Enumerable.ToArray[IUnitOption] (IEnumerable`1 source)
Bolt.UnitBase.Subset (Bolt.UnitOptionFilter filter, UnityEngine.GameObject parent, Bolt.FlowGraph graph) (at C:/Users/Lazlo/Projects/Ludiq/Bolt.Flow/Editor/Options/UnitBase.cs:153)
Bolt.UnitOptionTree.Prewarm () (at C:/Users/Lazlo/Projects/Ludiq/Bolt.Flow/Editor/Options/UnitOptionTree.cs:47)
Ludiq.FuzzyWindow+<>c__DisplayClass21_0.<Initialize>b__0 () (at C:/Users/Lazlo/Projects/Ludiq/Ludiq.Core/Editor/Interface/Fuzzy/FuzzyWindow.cs:234)
Ludiq.FuzzyWindow.Work () (at C:/Users/Lazlo/Projects/Ludiq/Ludiq.Core/Editor/Interface/Fuzzy/FuzzyWindow.cs:993)
UnityEngine.Debug:LogException(Exception)
Ludiq.FuzzyWindow:Work() (at C:/Users/Lazlo/Projects/Ludiq/Ludiq.Core/Editor/Interface/Fuzzy/FuzzyWindow.cs:998)


ArgumentNullException: Argument cannot be null.
Parameter name: source
System.Linq.Check.SourceAndPredicate (System.Object source, System.Object predicate)
System.Linq.Enumerable.Where[IUnitOption] (IEnumerable`1 source, System.Func`2 predicate)
Bolt.UnitOptionTree+Favorites.get_options () (at C:/Users/Lazlo/Projects/Ludiq/Bolt.Flow/Editor/Options/UnitOptionTree.cs:654)
Bolt.UnitOptionTree+Favorites+<GetEnumerator>d__10.MoveNext () (at C:/Users/Lazlo/Projects/Ludiq/Bolt.Flow/Editor/Options/UnitOptionTree.cs:662)
System.Linq.Enumerable+<CreateWhereIterator>c__Iterator1D`1[System.Object].MoveNext ()
System.Collections.Generic.List`1[System.Object].AddEnumerable (IEnumerable`1 enumerable) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Collections.Generic/List.cs:128)
System.Collections.Generic.List`1[System.Object]..ctor (IEnumerable`1 collection) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Collections.Generic/List.cs:65)
System.Linq.Enumerable.ToArray[Object] (IEnumerable`1 source)
Ludiq.FuzzyWindow.Populate (Ludiq.FuzzyOptionNode node, IEnumerable`1 childrenValues, Nullable`1 cancellation) (at C:/Users/Lazlo/Projects/Ludiq/Ludiq.Core/Editor/Interface/Fuzzy/FuzzyWindow.cs:22)
Ludiq.FuzzyWindow.<UpdateFavorites>b__53_0 () (at C:/Users/Lazlo/Projects/Ludiq/Ludiq.Core/Editor/Interface/Fuzzy/FuzzyWindow.cs:452)
Ludiq.FuzzyWindow.Work () (at C:/Users/Lazlo/Projects/Ludiq/Ludiq.Core/Editor/Interface/Fuzzy/FuzzyWindow.cs:993)
UnityEngine.Debug:LogException(Exception)
Ludiq.FuzzyWindow:Work() (at C:/Users/Lazlo/Projects/Ludiq/Ludiq.Core/Editor/Interface/Fuzzy/FuzzyWindow.cs:998)

Bolt Version:
Unity Version:
Platform(s):
Scripting Backend:
.NET Version (API Compatibility Level):

May have been due to renaming my Item but running Tools/Update Unit Options fixed this issue.

Correct, that is exactly why and it is supposed to happen. When you change the class name, a reference to the old one still exist and can't be found. You needed to update when classes are added or changed to set the new database options with that class. Which may also break connections as the references are not the same. Updating stuff inside an already existing class will not break anything though, and hot reload fine.

Pending Review

You must regenerate your unit options after compiling custom units.

The error message will be improved in the next version to make that clear.

Also, the incremental unit database update will help with this sometimes. In some cases, it will be able to detect in which DLL or script your unit changed, and update only that script. This is experimental, but will be available in v.1.2.2.