Serialization Debugger exception from the TypeSelector

Issue #381 resolved
nick martel created an issue

The dropdown to pick the type to debug in the Serialization Debugger prints an error when clicking it, and does nothing.

[15:41:01:343] NullReferenceException: Object reference not set to an instance of an object
UnityEditor.AssetPreview.GetMiniTypeThumbnail (System.Type type) (at C:/buildslave/unity/build/artifacts/generated/bindings_old/common/Editor/AssetPreviewBindings.gen.cs:98)
Sirenix.Utilities.Editor.GUIHelper+<>c.<GetAssetThumbnail>b__135_0 (System.Type t) (at F:/Sirenix/Sirenix Solution/Sirenix.Utilities.Editor/GUI/GUIHelper.cs:1138)
System.Linq.Enumerable+SelectEnumerableIterator`2[TSource,TResult].MoveNext () (at <839a3cb835c04d14aeb58d83bb7bc4bd>:0)
System.Linq.Enumerable.TryGetFirst[TSource] (System.Collections.Generic.IEnumerable`1[T] source, System.Func`2[T,TResult] predicate, System.Boolean& found) (at <839a3cb835c04d14aeb58d83bb7bc4bd>:0)
System.Linq.Enumerable.FirstOrDefault[TSource] (System.Collections.Generic.IEnumerable`1[T] source, System.Func`2[T,TResult] predicate) (at <839a3cb835c04d14aeb58d83bb7bc4bd>:0)
Sirenix.Utilities.Editor.GUIHelper.GetAssetThumbnail (UnityEngine.Object obj, System.Type type, System.Boolean preferObjectPreviewOverFileIcon) (at F:/Sirenix/Sirenix Solution/Sirenix.Utilities.Editor/GUI/GUIHelper.cs:1137)
Sirenix.OdinInspector.Editor.OdinMenuTreeExtensions.AddThumbnailIcon (Sirenix.OdinInspector.Editor.OdinMenuItem item, System.Boolean preferAssetPreviewAsIcon) (at F:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/OdinSelectors/TypeSelector.cs:126)
Sirenix.OdinInspector.Editor.OdinMenuTreeExtensions.AddThumbnailIcons (System.Collections.Generic.IEnumerable`1[T] menuItems, System.Boolean preferAssetPreviewAsIcon) (at F:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/OdinSelectors/TypeSelector.cs:78)
Sirenix.OdinInspector.Editor.TypeSelector.BuildSelectionTree (Sirenix.OdinInspector.Editor.OdinMenuTree tree) (at <318f40a3260646299b4357350c53962c>:0)
Sirenix.OdinInspector.Editor.OdinSelector`1[T].get_SelectionTree () (at F:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Config/InspectorTypeDrawingConfig.cs:54)
Sirenix.OdinInspector.Editor.TypeSelector.SetSelection (System.Type selected) (at F:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Core/Children/PropertyValueCollectionAlias.cs:46)
VFWAdditions.Drawers.TypePickerDrawer`1[T].DrawPropertyLayout (Sirenix.OdinInspector.Editor.IPropertyValueEntry`1[TValue] entry, Util.TypePickerAttribute attribute, UnityEngine.GUIContent label) (at Assets/Editor/VFWAdditions/Drawers/TypePickerDrawer.cs:56)
Sirenix.OdinInspector.Editor.OdinAttributeDrawer`2[TAttribute,TValue].DrawPropertyLayout (Sirenix.OdinInspector.Editor.InspectorProperty property, TAttribute attribute, UnityEngine.GUIContent label) (at F:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Core/PropertyTree.cs:2273)
Sirenix.OdinInspector.Editor.OdinAttributeDrawer`1[TAttribute].DrawPropertyImplementation (Sirenix.OdinInspector.Editor.InspectorProperty property, UnityEngine.GUIContent label) (at F:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Core/PropertyTree.cs:2167)
Sirenix.OdinInspector.Editor.OdinDrawer.DrawProperty (Sirenix.OdinInspector.Editor.InspectorProperty property, UnityEngine.GUIContent label) (at <318f40a3260646299b4357350c53962c>:0)
Sirenix.OdinInspector.Editor.OdinDrawer.CallNextDrawer (Sirenix.OdinInspector.Editor.InspectorProperty property, UnityEngine.GUIContent label) (at <318f40a3260646299b4357350c53962c>:0)
Sirenix.OdinInspector.Editor.OdinDrawer.CallNextDrawer (Sirenix.OdinInspector.Editor.IPropertyValueEntry entry, UnityEngine.GUIContent label) (at F:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Core/Value Entries/PropertyListValueEntryChanger.cs:79)
Sirenix.OdinInspector.Editor.Drawers.FixUnityNullDrawer`1[T].DrawPropertyLayout (Sirenix.OdinInspector.Editor.IPropertyValueEntry`1[TValue] entry, UnityEngine.GUIContent label) (at <318f40a3260646299b4357350c53962c>:0)
Sirenix.OdinInspector.Editor.OdinValueDrawer`1[T].DrawProperty (Sirenix.OdinInspector.Editor.IPropertyValueEntry`1[TValue] entry, UnityEngine.GUIContent label) (at F:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Core/Value Entries/PropertyMemberValueEntry.cs:48)
Sirenix.OdinInspector.Editor.OdinValueDrawer`1[T].DrawPropertyImplementation (Sirenix.OdinInspector.Editor.InspectorProperty property, UnityEngine.GUIContent label) (at F:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Core/Value Entries/PropertyMemberValueEntry.cs:39)
Sirenix.OdinInspector.Editor.OdinDrawer.DrawProperty (Sirenix.OdinInspector.Editor.InspectorProperty property, UnityEngine.GUIContent label) (at <318f40a3260646299b4357350c53962c>:0)
Sirenix.OdinInspector.Editor.OdinDrawer.CallNextDrawer (Sirenix.OdinInspector.Editor.InspectorProperty property, UnityEngine.GUIContent label) (at <318f40a3260646299b4357350c53962c>:0)
Sirenix.OdinInspector.Editor.OdinDrawer.CallNextDrawer (Sirenix.OdinInspector.Editor.IPropertyValueEntry entry, UnityEngine.GUIContent label) (at F:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Core/Value Entries/PropertyListValueEntryChanger.cs:79)
Sirenix.OdinInspector.Editor.Drawers.PropertyContextMenuDrawer`1[T].DrawPropertyLayout (Sirenix.OdinInspector.Editor.IPropertyValueEntry`1[TValue] entry, UnityEngine.GUIContent label) <0x3e502140 + 0x000f2> in <318f40a3260646299b4357350c53962c>:0
Sirenix.OdinInspector.Editor.OdinValueDrawer`1[T].DrawProperty (Sirenix.OdinInspector.Editor.IPropertyValueEntry`1[TValue] entry, UnityEngine.GUIContent label) (at F:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Core/Value Entries/PropertyMemberValueEntry.cs:48)
Sirenix.OdinInspector.Editor.OdinValueDrawer`1[T].DrawPropertyImplementation (Sirenix.OdinInspector.Editor.InspectorProperty property, UnityEngine.GUIContent label) (at F:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Core/Value Entries/PropertyMemberValueEntry.cs:39)
Sirenix.OdinInspector.Editor.OdinDrawer.DrawProperty (Sirenix.OdinInspector.Editor.InspectorProperty property, UnityEngine.GUIContent label) (at <318f40a3260646299b4357350c53962c>:0)
Sirenix.OdinInspector.Editor.InspectorUtilities.DrawProperty (Sirenix.OdinInspector.Editor.InspectorProperty property, UnityEngine.GUIContent label) (at <318f40a3260646299b4357350c53962c>:0)
Rethrow as OdinPropertyException: This error occurred while being drawn by Odin.
Odin Property Path: internalData.testType
Odin Drawer Chain: PropertyContextMenuDrawer<Type>, FixUnityNullDrawer<Type>, TypePickerDrawer<Type>, ReferencePathConflictDrawer<Type>, ReferenceValueConflictDrawer<Type>, TypeDrawer<Type>, NullableReferenceDrawer<Type>.
UnityEngine.Debug:LogException(Exception)
Sirenix.OdinInspector.Editor.InspectorUtilities:DrawProperty(InspectorProperty, GUIContent)
Sirenix.OdinInspector.Editor.InspectorUtilities:DrawProperty(InspectorProperty)
Sirenix.OdinInspector.Editor.Drawers.CompositeDrawer:DrawPropertyImplementation(InspectorProperty, GUIContent) (at F:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Drawers/Value Drawers/ColorDrawer.cs:73)
Sirenix.OdinInspector.Editor.OdinDrawer:DrawProperty(InspectorProperty, GUIContent)
Sirenix.OdinInspector.Editor.OdinDrawer:CallNextDrawer(InspectorProperty, GUIContent)
Sirenix.OdinInspector.Editor.Drawers.NullableReferenceDrawer`1:DrawPropertyLayout(IPropertyValueEntry`1, GUIContent) (at F:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Drawers/Attribute Drawers/AssetListAttributeDrawer.cs:464)
Sirenix.OdinInspector.Editor.OdinValueDrawer`1:DrawProperty(IPropertyValueEntry`1, GUIContent) (at F:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Core/Value Entries/PropertyMemberValueEntry.cs:48)
Sirenix.OdinInspector.Editor.OdinValueDrawer`1:DrawPropertyImplementation(InspectorProperty, GUIContent) (at F:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Core/Value Entries/PropertyMemberValueEntry.cs:39)
Sirenix.OdinInspector.Editor.OdinDrawer:DrawProperty(InspectorProperty, GUIContent)
Sirenix.OdinInspector.Editor.OdinDrawer:CallNextDrawer(InspectorProperty, GUIContent)
Sirenix.OdinInspector.Editor.Drawers.ReferenceValueConflictDrawer`1:DrawPropertyLayout(IPropertyValueEntry`1, GUIContent) (at F:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Drawers/Misc Drawers/PropertyContextMenuDrawer.cs:113)
Sirenix.OdinInspector.Editor.OdinValueDrawer`1:DrawProperty(IPropertyValueEntry`1, GUIContent) (at F:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Core/Value Entries/PropertyMemberValueEntry.cs:48)
Sirenix.OdinInspector.Editor.OdinValueDrawer`1:DrawPropertyImplementation(InspectorProperty, GUIContent) (at F:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Core/Value Entries/PropertyMemberValueEntry.cs:39)
Sirenix.OdinInspector.Editor.OdinDrawer:DrawProperty(InspectorProperty, GUIContent)
Sirenix.OdinInspector.Editor.OdinDrawer:CallNextDrawer(InspectorProperty, GUIContent)
Sirenix.OdinInspector.Editor.Drawers.ReferencePathConflictDrawer`1:DrawPropertyLayout(IPropertyValueEntry`1, GUIContent) (at F:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Drawers/Misc Drawers/NullableReferenceDrawer.cs:148)
Sirenix.OdinInspector.Editor.OdinValueDrawer`1:DrawProperty(IPropertyValueEntry`1, GUIContent) (at F:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Core/Value Entries/PropertyMemberValueEntry.cs:48)
Sirenix.OdinInspector.Editor.OdinValueDrawer`1:DrawPropertyImplementation(InspectorProperty, GUIContent) (at F:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Core/Value Entries/PropertyMemberValueEntry.cs:39)
Sirenix.OdinInspector.Editor.OdinDrawer:DrawProperty(InspectorProperty, GUIContent)
Sirenix.OdinInspector.Editor.OdinDrawer:CallNextDrawer(InspectorProperty, GUIContent)
Sirenix.OdinInspector.Editor.OdinDrawer:CallNextDrawer(IPropertyValueEntry, GUIContent) (at F:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Core/Value Entries/PropertyListValueEntryChanger.cs:79)
Sirenix.OdinInspector.Editor.Drawers.FixUnityNullDrawer`1:DrawPropertyLayout(IPropertyValueEntry`1, GUIContent)
Sirenix.OdinInspector.Editor.OdinValueDrawer`1:DrawProperty(IPropertyValueEntry`1, GUIContent) (at F:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Core/Value Entries/PropertyMemberValueEntry.cs:48)
Sirenix.OdinInspector.Editor.OdinValueDrawer`1:DrawPropertyImplementation(InspectorProperty, GUIContent) (at F:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Core/Value Entries/PropertyMemberValueEntry.cs:39)
Sirenix.OdinInspector.Editor.OdinDrawer:DrawProperty(InspectorProperty, GUIContent)
Sirenix.OdinInspector.Editor.OdinDrawer:CallNextDrawer(InspectorProperty, GUIContent)
Sirenix.OdinInspector.Editor.Drawers.ReferenceDrawer`1:DrawPropertyLayout(IPropertyValueEntry`1, GUIContent) (at F:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Drawers/Misc Drawers/NullableReferenceDrawer.cs:112)
Sirenix.OdinInspector.Editor.OdinValueDrawer`1:DrawProperty(IPropertyValueEntry`1, GUIContent) (at F:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Core/Value Entries/PropertyMemberValueEntry.cs:48)
Sirenix.OdinInspector.Editor.OdinValueDrawer`1:DrawPropertyImplementation(InspectorProperty, GUIContent) (at F:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Core/Value Entries/PropertyMemberValueEntry.cs:39)
Sirenix.OdinInspector.Editor.OdinDrawer:DrawProperty(InspectorProperty, GUIContent)
Sirenix.OdinInspector.Editor.OdinDrawer:CallNextDrawer(InspectorProperty, GUIContent)
Sirenix.OdinInspector.Editor.OdinDrawer:CallNextDrawer(IPropertyValueEntry, GUIContent) (at F:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Core/Value Entries/PropertyListValueEntryChanger.cs:79)
Sirenix.OdinInspector.Editor.Drawers.PropertyContextMenuDrawer`1:DrawPropertyLayout(IPropertyValueEntry`1, GUIContent)
Sirenix.OdinInspector.Editor.OdinValueDrawer`1:DrawProperty(IPropertyValueEntry`1, GUIContent) (at F:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Core/Value Entries/PropertyMemberValueEntry.cs:48)
Sirenix.OdinInspector.Editor.OdinValueDrawer`1:DrawPropertyImplementation(InspectorProperty, GUIContent) (at F:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Core/Value Entries/PropertyMemberValueEntry.cs:39)
Sirenix.OdinInspector.Editor.OdinDrawer:DrawProperty(InspectorProperty, GUIContent)
Sirenix.OdinInspector.Editor.OdinDrawer:CallNextDrawer(InspectorProperty, GUIContent)
Sirenix.OdinInspector.Editor.Drawers.OdinSerializeAttributeWarningDrawer:DrawPropertyLayout(InspectorProperty, OdinSerializeAttribute, GUIContent) (at F:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Config/InspectorTypeDrawingConfigDrawer.cs:115)
Sirenix.OdinInspector.Editor.OdinAttributeDrawer`1:DrawPropertyImplementation(InspectorProperty, GUIContent) (at F:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Core/PropertyTree.cs:2167)
Sirenix.OdinInspector.Editor.OdinDrawer:DrawProperty(InspectorProperty, GUIContent)
Sirenix.OdinInspector.Editor.InspectorUtilities:DrawProperty(InspectorProperty, GUIContent)
Sirenix.OdinInspector.Editor.InspectorUtilities:DrawProperty(InspectorProperty)
Sirenix.OdinInspector.Editor.InspectorUtilities:DrawPropertiesInTree(PropertyTree)
Sirenix.OdinInspector.Editor.PropertyTree:Draw(Boolean)
Sirenix.OdinInspector.Editor.OdinEditor:DrawTree() (at F:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Core/Children/PropertyValueCollection.cs:541)
Sirenix.OdinInspector.Editor.OdinEditor:DrawOdinInspector() (at F:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Core/Children/PropertyValueCollection.cs:533)
Sirenix.OdinInspector.Editor.OdinEditor:OnInspectorGUI() (at F:/Sirenix/Sirenix Solution/Sirenix.OdinInspector.Editor/Core/Children/PropertyValueCollection.cs:516)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)

Comments (4)

  1. mSkull001

    Could you provide some more information on this issue? Which version of Unity did the issue occur in? Which type are you trying to debug?

  2. nick martel reporter

    Unity 2018.16f1

    I get the same thing when I try to use the dropdown from the Type drawer (with a type field in a scriptableobject) so I'm guessing there's a type in particular in our project that is causing this when it tries to draw it. The type to debug could be any, I just can't open the dropdown at all to pick which type.

  3. mSkull001

    I have been unable to reproduce or find a reason as to why Unity's AssetPreview.GetMiniTypeThumbnail sometimes throws throw an exception for some types. But GUIHelper.GetAssetThumbnail will now catch the exception and ignore it. The Type Selector should therefore not break anymore.

  4. Log in to comment