Search Issue Tracker

Not Reproducible

Votes

1

Found in [Package]

1.0.0-pre.10

Issue ID

LOC-291

Regression

Yes

NullReferenceException in LocalizationSettings editor when assembly reload occurs.

Package: Localization Package

-

Found in 2020.3.12f1

1) Open LocalizationSettings under Edit/ProjectSettings
2) Reimport a script asset so that an assembly reload is triggered whilst the Editor is open
3) The Editor window will go blank and a NullReferenceException will be thrown.

NullReferenceException: Object reference not set to an instance of an object
UnityEditor.UIElements.InspectorElement.GetOrCreateEditor (UnityEditor.SerializedObject serializedObject) (at <4161219cc34143e0a11c6faeaa303a62>:0)
UnityEditor.UIElements.InspectorElement.Reset (UnityEditor.SerializedObject bindObject) (at <4161219cc34143e0a11c6faeaa303a62>:0)
UnityEditor.UIElements.InspectorElement.ExecuteDefaultActionAtTarget (UnityEngine.UIElements.EventBase evt) (at <4161219cc34143e0a11c6faeaa303a62>:0)
UnityEngine.UIElements.CallbackEventHandler.HandleEvent (UnityEngine.UIElements.EventBase evt) (at <001bec72e88e4f3a9eb0246a4215b1a5>:0)
UnityEngine.UIElements.CallbackEventHandler.HandleEventAtTargetPhase (UnityEngine.UIElements.EventBase evt) (at <001bec72e88e4f3a9eb0246a4215b1a5>:0)
UnityEditor.UIElements.Bindings.SerializedObjectBindingContext.SendBindingEvent[TEventType] (TEventType evt, UnityEngine.UIElements.VisualElement target) (at <4161219cc34143e0a11c6faeaa303a62>:0)
UnityEditor.UIElements.Bindings.SerializedObjectBindingContext.BindTree (UnityEngine.UIElements.VisualElement element, UnityEditor.SerializedProperty parentProperty) (at <4161219cc34143e0a11c6faeaa303a62>:0)
UnityEditor.UIElements.Bindings.SerializedObjectBindingContext.ContinueBinding (UnityEngine.UIElements.VisualElement element, UnityEditor.SerializedProperty parentProperty) (at <4161219cc34143e0a11c6faeaa303a62>:0)
UnityEditor.UIElements.Bindings.SerializedObjectBindingContext.Bind (UnityEngine.UIElements.VisualElement element) (at <4161219cc34143e0a11c6faeaa303a62>:0)
UnityEditor.UIElements.Bindings.DefaultSerializedObjectBindingImplementation.Bind (UnityEngine.UIElements.VisualElement element, UnityEditor.SerializedObject obj) (at <4161219cc34143e0a11c6faeaa303a62>:0)
UnityEditor.UIElements.BindingExtensions.Bind (UnityEngine.UIElements.VisualElement element, UnityEditor.SerializedObject obj) (at <4161219cc34143e0a11c6faeaa303a62>:0)
UnityEditor.UIElements.InspectorElement..ctor (UnityEngine.Object obj, UnityEditor.UIElements.InspectorElement+Mode mode) (at <4161219cc34143e0a11c6faeaa303a62>:0)
UnityEditor.UIElements.InspectorElement..ctor (UnityEngine.Object obj) (at <4161219cc34143e0a11c6faeaa303a62>:0)
UnityEditor.Localization.UI.LocalizationSettingsProvider.OnActivate (System.String searchContext, UnityEngine.UIElements.VisualElement rootElement) (at C:/Unity/Packages/com.unity.localization/Packages/com.unity.localization/Editor/UI/Settings/LocalizationSettingsProvider.cs:37)
UnityEditor.SettingsWindow.ProviderChanged (UnityEditor.SettingsProvider lastSelectedProvider, UnityEditor.SettingsProvider newlySelectedProvider) (at <dc14d30a5e0540ee9311ed6df63d9074>:0)
UnityEditor.SettingsTreeView.SelectionChanged (System.Collections.Generic.IList`1[T] selectedIds) (at <dc14d30a5e0540ee9311ed6df63d9074>:0)
UnityEditor.SettingsTreeView.FocusSelection (System.Int32 selectedId) (at <dc14d30a5e0540ee9311ed6df63d9074>:0)
UnityEditor.SettingsWindow.SelectProviderByName (System.String name) (at <dc14d30a5e0540ee9311ed6df63d9074>:0)
UnityEditor.SettingsWindow.RestoreSelection () (at <dc14d30a5e0540ee9311ed6df63d9074>:0)
UnityEditor.SettingsWindow.OnEnable () (at <dc14d30a5e0540ee9311ed6df63d9074>:0)

  1. Resolution Note:

    We could not reproduce the issue in the latest localization package and any of the unity versions including Unity 2020.3/15f1.

Comments (2)

  1. novinocti

    Apr 21, 2022 18:42

    I have this same error using 2020.3.17 in localization packages 1.0.5 and again 1.1.0
    As best as I can tell this only happens when changes have been made to a scene and play is used in the editor. After stopping and restarting the error disappears.

    Note: this error is not constant and does not always appear in the situation described above. It also does not appear to effect anything I have noticed at run time.

    NullReferenceException: Object reference not set to an instance of an object
    UnityEditor.UIElements.InspectorElement.GetOrCreateEditor (UnityEditor.SerializedObject serializedObject) (at <17cba49fae414354b79f447a7073fc5b>:0)
    UnityEditor.UIElements.InspectorElement.Reset (UnityEditor.SerializedObject bindObject) (at <17cba49fae414354b79f447a7073fc5b>:0)
    UnityEditor.UIElements.InspectorElement.ExecuteDefaultActionAtTarget (UnityEngine.UIElements.EventBase evt) (at <17cba49fae414354b79f447a7073fc5b>:0)
    UnityEngine.UIElements.CallbackEventHandler.HandleEvent (UnityEngine.UIElements.EventBase evt) (at <f28f649cfb6a4dd5a118cb05800b248d>:0)
    UnityEngine.UIElements.CallbackEventHandler.HandleEventAtTargetPhase (UnityEngine.UIElements.EventBase evt) (at <f28f649cfb6a4dd5a118cb05800b248d>:0)
    UnityEditor.UIElements.Bindings.SerializedObjectBindingContext.SendBindingEvent[TEventType] (TEventType evt, UnityEngine.UIElements.VisualElement target) (at <17cba49fae414354b79f447a7073fc5b>:0)
    UnityEditor.UIElements.Bindings.SerializedObjectBindingContext.BindTree (UnityEngine.UIElements.VisualElement element, UnityEditor.SerializedProperty parentProperty) (at <17cba49fae414354b79f447a7073fc5b>:0)
    UnityEditor.UIElements.Bindings.SerializedObjectBindingContext.ContinueBinding (UnityEngine.UIElements.VisualElement element, UnityEditor.SerializedProperty parentProperty) (at <17cba49fae414354b79f447a7073fc5b>:0)
    UnityEditor.UIElements.Bindings.SerializedObjectBindingContext.Bind (UnityEngine.UIElements.VisualElement element) (at <17cba49fae414354b79f447a7073fc5b>:0)
    UnityEditor.UIElements.Bindings.DefaultSerializedObjectBindingImplementation.Bind (UnityEngine.UIElements.VisualElement element, UnityEditor.SerializedObject obj) (at <17cba49fae414354b79f447a7073fc5b>:0)
    UnityEditor.UIElements.BindingExtensions.Bind (UnityEngine.UIElements.VisualElement element, UnityEditor.SerializedObject obj) (at <17cba49fae414354b79f447a7073fc5b>:0)
    UnityEditor.UIElements.InspectorElement..ctor (UnityEngine.Object obj, UnityEditor.UIElements.InspectorElement+Mode mode) (at <17cba49fae414354b79f447a7073fc5b>:0)
    UnityEditor.UIElements.InspectorElement..ctor (UnityEngine.Object obj) (at <17cba49fae414354b79f447a7073fc5b>:0)
    UnityEditor.Localization.UI.LocalizationSettingsProvider.OnActivate (System.String searchContext, UnityEngine.UIElements.VisualElement rootElement) (at Library/PackageCache/com.unity.localization@1.1.0/Editor/UI/Settings/LocalizationSettingsProvider.cs:37)
    UnityEditor.SettingsWindow.ProviderChanged (UnityEditor.SettingsProvider lastSelectedProvider, UnityEditor.SettingsProvider newlySelectedProvider) (at <d0e4b8c1204147f3935b6e9c8b8565ad>:0)
    UnityEditor.SettingsTreeView.SelectionChanged (System.Collections.Generic.IList`1[T] selectedIds) (at <d0e4b8c1204147f3935b6e9c8b8565ad>:0)
    UnityEditor.SettingsTreeView.FocusSelection (System.Int32 selectedId) (at <d0e4b8c1204147f3935b6e9c8b8565ad>:0)
    UnityEditor.SettingsWindow.SelectProviderByName (System.String name) (at <d0e4b8c1204147f3935b6e9c8b8565ad>:0)
    UnityEditor.SettingsWindow.RestoreSelection () (at <d0e4b8c1204147f3935b6e9c8b8565ad>:0)
    UnityEditor.SettingsWindow.OnEnable () (at <d0e4b8c1204147f3935b6e9c8b8565ad>:0)

  2. siddharth3322

    Aug 02, 2021 13:44

    When I press Play button within the Unity editor - directly I was getting this error:

    NullReferenceException: Object reference not set to an instance of an object
    UnityEditor.UIElements.InspectorElement.GetOrCreateEditor (UnityEditor.SerializedObject serializedObject) (at /Users/bokken/buildslave/unity/build/External/MirroredPackageSources/com.unity.ui/Editor/Inspector/InspectorElement.cs:351)
    UnityEditor.UIElements.InspectorElement.Reset (UnityEditor.SerializedObject bindObject) (at /Users/bokken/buildslave/unity/build/External/MirroredPackageSources/com.unity.ui/Editor/Inspector/InspectorElement.cs:289)
    UnityEditor.UIElements.InspectorElement.ExecuteDefaultActionAtTarget (UnityEngine.UIElements.EventBase evt) (at /Users/bokken/buildslave/unity/build/External/MirroredPackageSources/com.unity.ui/Editor/Inspector/InspectorElement.cs:337)
    UnityEngine.UIElements.CallbackEventHandler.HandleEvent (UnityEngine.UIElements.EventBase evt) (at /Users/bokken/buildslave/unity/build/External/MirroredPackageSources/com.unity.ui/Core/Events/EventHandler.cs:158)
    UnityEngine.UIElements.CallbackEventHandler.HandleEventAtTargetPhase (UnityEngine.UIElements.EventBase evt) (at /Users/bokken/buildslave/unity/build/External/MirroredPackageSources/com.unity.ui/Core/Events/EventHandler.cs:127)
    UnityEditor.UIElements.Bindings.SerializedObjectBindingContext.SendBindingEvent[TEventType] (TEventType evt, UnityEngine.UIElements.VisualElement target) (at /Users/bokken/buildslave/unity/build/External/MirroredPackageSources/com.unity.ui/Editor/Bindings/BindingExtensions.cs:85)
    UnityEditor.UIElements.Bindings.SerializedObjectBindingContext.BindTree (UnityEngine.UIElements.VisualElement element, UnityEditor.SerializedProperty parentProperty) (at /Users/bokken/buildslave/unity/build/External/MirroredPackageSources/com.unity.ui/Editor/Bindings/BindingExtensions.cs:103)
    UnityEditor.UIElements.Bindings.SerializedObjectBindingContext.ContinueBinding (UnityEngine.UIElements.VisualElement element, UnityEditor.SerializedProperty parentProperty) (at /Users/bokken/buildslave/unity/build/External/MirroredPackageSources/com.unity.ui/Editor/Bindings/BindingExtensions.cs:40)
    UnityEditor.UIElements.Bindings.SerializedObjectBindingContext.Bind (UnityEngine.UIElements.VisualElement element) (at /Users/bokken/buildslave/unity/build/External/MirroredPackageSources/com.unity.ui/Editor/Bindings/BindingExtensions.cs:31)
    UnityEditor.UIElements.Bindings.DefaultSerializedObjectBindingImplementation.Bind (UnityEngine.UIElements.VisualElement element, UnityEditor.SerializedObject obj) (at /Users/bokken/buildslave/unity/build/External/MirroredPackageSources/com.unity.ui/Editor/Bindings/BindingExtensions.cs:814)
    UnityEditor.UIElements.BindingExtensions.Bind (UnityEngine.UIElements.VisualElement element, UnityEditor.SerializedObject obj) (at /Users/bokken/buildslave/unity/build/External/MirroredPackageSources/com.unity.ui/Editor/Bindings/BindingsInterface.cs:50)
    UnityEditor.UIElements.InspectorElement..ctor (UnityEngine.Object obj, UnityEditor.UIElements.InspectorElement+Mode mode) (at /Users/bokken/buildslave/unity/build/External/MirroredPackageSources/com.unity.ui/Editor/Inspector/InspectorElement.cs:164)
    UnityEditor.UIElements.InspectorElement..ctor (UnityEngine.Object obj) (at /Users/bokken/buildslave/unity/build/External/MirroredPackageSources/com.unity.ui/Editor/Inspector/InspectorElement.cs:146)
    UnityEditor.Localization.UI.LocalizationSettingsProvider.OnActivate (System.String searchContext, UnityEngine.UIElements.VisualElement rootElement) (at Library/PackageCache/com.unity.localization@1.0.0-pre.10/Editor/UI/Settings/LocalizationSettingsProvider.cs:37)
    UnityEditor.SettingsWindow.ProviderChanged (UnityEditor.SettingsProvider lastSelectedProvider, UnityEditor.SettingsProvider newlySelectedProvider) (at /Users/bokken/buildslave/unity/build/Editor/Mono/Settings/SettingsWindow.cs:250)
    UnityEditor.SettingsTreeView.SelectionChanged (System.Collections.Generic.IList`1[T] selectedIds) (at /Users/bokken/buildslave/unity/build/Editor/Mono/Settings/SettingsTreeView.cs:66)
    UnityEditor.SettingsTreeView.FocusSelection (System.Int32 selectedId) (at /Users/bokken/buildslave/unity/build/Editor/Mono/Settings/SettingsTreeView.cs:46)
    UnityEditor.SettingsWindow.SelectProviderByName (System.String name) (at /Users/bokken/buildslave/unity/build/Editor/Mono/Settings/SettingsWindow.cs:80)
    UnityEditor.SettingsWindow.RestoreSelection () (at /Users/bokken/buildslave/unity/build/Editor/Mono/Settings/SettingsWindow.cs:198)
    UnityEditor.SettingsWindow.OnEnable () (at /Users/bokken/buildslave/unity/build/Editor/Mono/Settings/SettingsWindow.cs:106)

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.