In existing Project getting NullRef Exceptions when Reverting Prefabs

Issue #19 resolved
Björn von der Osten created an issue

When using uPrefabs in an already existing Project you get a NullRef exception when some Prefabs are not jet reimported. Its not that big of a deal, you can just reimport all Prefabs, but if the Project is big and Prefabs are all over the place it can take a while to find them all, it would be nice to at least get a message saying where the offending Prefab is located, or even better would be to just reimport the offending Prefab on the fly (AssetDatabase.ImportAsset()).

NullReferenceException: Object reference not set to an instance of an object
AntiheroStudios.uPrefabs.uPrefab.get_containingPrefab () (at Assets/AntiheroStudios/uPrefabs/uPrefab.cs:46)
AntiheroStudios.uPrefabs.Editor.uPrefabRevertUtilities.RevertAllObjectInstances (AntiheroStudios.uPrefabs.uObject asset) (at Assets/AntiheroStudios/uPrefabs/Editor/uPrefabRevertUtilities.cs:286)
AntiheroStudios.uPrefabs.Editor.GameObjectCustomInspector+<OnDrawPrefab>c__AnonStorey0.<>m__13 () (at Assets/AntiheroStudios/uPrefabs/Editor/uPrefabGameObjectInspector.cs:481)
AntiheroStudios.uPrefabs.Editor.uPrefabRevertPopupWindow.OnGUI (Rect rect) (at Assets/AntiheroStudios/uPrefabs/Editor/uPrefabRevertPopupWindow.cs:49)
UnityEditor.PopupWindow.OnGUI () (at C:/buildslave/unity/build/Editor/Mono/GUI/PopupWindow.cs:83)
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:187)
UnityEditor.HostView.Invoke (System.String methodName) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:180)
UnityEditor.HostView.OnGUI () (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:76)

Comments (1)

  1. Devon Klompmaker

    I believe this has been resolved in 1.4f4, so I'll mark it as resolved. If you'd like the most recent version before it is released on asset store, please email me at devon@antihero-studios.com with your purchase invoice id and I can keep you up to date with newer releases.

  2. Log in to comment