I've been using Unity for several years now...and I've never come across this issue.
Whenever I try to apply or revert a prefab, it is giving the following error:
NullReferenceException: Object reference not set to an instance of an object
UnityEditor.PrefabUtility.RegisterNewObjects (System.Collections.Generic.List1 newHierarchy, System.Collections.Generic.List
1 hierarchy, System.String actionName) (at C:/buildslave/unity/build/Editor/Mono/ImportSettings/PrefabUtility.cs:121)
(Full Stack trace below)
Any idea what is the cause? The changes do seem to apply, I've moved things around in the tree, and modified values and they do apply. But the error is somewhat concerning and I'd rather not have an error. Any ideas/suggestions?
Full Stack Trace
NullReferenceException: Object reference not set to an instance of an object
UnityEditor.PrefabUtility.RegisterNewObjects (System.Collections.Generic.List`1 newHierarchy, System.Collections.Generic.List`1 hierarchy, System.String actionName) (at C:/buildslave/unity/build/Editor/Mono/ImportSettings/PrefabUtility.cs:121)
UnityEditor.PrefabUtility.ReplacePrefabWithUndo (UnityEngine.GameObject target) (at C:/buildslave/unity/build/Editor/Mono/ImportSettings/PrefabUtility.cs:223)
UnityEditor.GameObjectInspector.DoPrefabButtons (PrefabType prefabType, UnityEngine.GameObject go) (at C:/buildslave/unity/build/Editor/Mono/Inspector/GameObjectInspector.cs:347)
UnityEditor.GameObjectInspector.DrawInspector () (at C:/buildslave/unity/build/Editor/Mono/Inspector/GameObjectInspector.cs:260)
UnityEditor.GameObjectInspector.OnHeaderGUI () (at C:/buildslave/unity/build/Editor/Mono/Inspector/GameObjectInspector.cs:170)
UnityEditor.Editor.DrawHeader () (at C:/buildslave/unity/build/Editor/Mono/Inspector/Editor.cs:420)
UnityEditor.InspectorWindow.DrawEditor (UnityEditor.Editor[] editors, Int32 editorIndex, Boolean rebuildOptimizedGUIBlock, System.Boolean& showImportedObjectBarNext, UnityEngine.Rect& importedObjectBarRect) (at C:/buildslave/unity/build/Editor/Mono/Inspector/InspectorWindow.cs:1125)
UnityEditor.InspectorWindow.DrawEditors (UnityEditor.Editor[] editors) (at C:/buildslave/unity/build/Editor/Mono/Inspector/InspectorWindow.cs:1030)
UnityEditor.InspectorWindow.OnGUI () (at C:/buildslave/unity/build/Editor/Mono/Inspector/InspectorWindow.cs:361)
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)
Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:232)
System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MethodBase.cs:115)
UnityEditor.HostView.Invoke (System.String methodName, System.Object obj) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:295)
UnityEditor.HostView.Invoke (System.String methodName) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:288)
UnityEditor.HostView.InvokeOnGUI (Rect onGUIPosition) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:255)
EDIT: I was asked to explain how its different to the flagged duplicate question. This is not asking simply "What is a Null Reference". I'm fully aware of a null reference (as I said I've used Unity for many years now). This question is in regards to a specific case of null references, where applying a Unity prefab is causing a null reference in the editor, referencing UnityEditor scripts (that I haven't written).