+1
Unity Bug

NullReferenceException when applying Variables to Nested Prefab [Unity 2018.3b6]

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

If you use the new apply on the variables change you get the following exception

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

UnityEditor.PrefabUtility.ApplySingleProperty (UnityEditor.SerializedProperty instanceProperty, UnityEditor.SerializedObject prefabSourceSerializedObject, System.String assetPath, Boolean isObjectOnRootInAsset, Boolean singlePropertyOnly, System.Collections.Generic.List`1 serializedObjects, InteractionMode action) (at C:/buildslave/unity/build/Editor/Mono/Prefabs/PrefabUtility.cs:536)

UnityEditor.PrefabUtility.ApplyPropertyOverrides (UnityEngine.Object prefabInstanceObject, UnityEditor.SerializedProperty optionalSingleInstanceProperty, System.String assetPath, InteractionMode action) (at C:/buildslave/unity/build/Editor/Mono/Prefabs/PrefabUtility.cs:442)

UnityEditor.PrefabUtility.ApplyObjectOverride (UnityEngine.Object instanceComponentOrGameObject, System.String assetPath, InteractionMode action) (at C:/buildslave/unity/build/Editor/Mono/Prefabs/PrefabUtility.cs:562)

UnityEditor.SceneManagement.ObjectOverride.Apply (System.String prefabAssetPath) (at C:/buildslave/unity/build/Editor/Mono/Prefabs/PrefabOverrides/PrefabOverride.cs:58)

UnityEditor.PrefabOverridesTreeView+ComparisonViewPopup.Apply (System.Object prefabAssetPathObject) (at C:/buildslave/unity/build/Editor/Mono/Prefabs/PrefabOverrides/PrefabOverridesTreeView.cs:703)

UnityEditor.GenericMenu.CatchMenu (System.Object userData, System.String[] options, Int32 selected) (at C:/buildslave/unity/build/Editor/Mono/GUI/GenericMenu.cs:119)

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

Hi Eric!

There is literally zero Bolt code involved in that exception, which makes me think it might be a bug in the prefab preview itself. Have you tried reporting it to Unity?