Search Issue Tracker

Fixed in 2021.2.X

Fixed in 2021.1.X

Votes

0

Found in

2020.2.0a20

2021.1

2021.1.0b9

2021.2

Issue ID

1317724

Regression

No

NullReferenceException is thrown on clicking, "Take Snapshot" button in Indoors/Outdoors Scene Template

Scene Template

-

NullReferenceException and FileNotFoundException is thrown on clicking on, "Take Snapshot" button in Indoors/OutdoorsScene Template. Refer the attached video

Steps to repro:
1. Use any project containing a scene
2. create a scene template from that scene.
3. Load the scene.
4. Click Take Snapshot

The bug is not related to HDRP.

Actual Result:
NullReferenceException and FileNotFoundException is thrown in the console.

Expected Result:
No errors should be thrown in the console.

Reproducible in:
2021.2.0a7, 2021.1.0b9, 2020.2.0a20

Environment:
Occurring on Windows 10 & Mac 10.15.

Stacktrace:
1)NullReferenceException: SerializedObject of SerializedProperty has been Disposed.
UnityEditor.SerializedProperty.set_objectReferenceValue (UnityEngine.Object value) (at <374fc8f7339747be937094441020097b>:0)
UnityEditor.SceneTemplate.SceneTemplateAssetInspectorWindow.TakeSnapshotFromCamera (UnityEditor.SceneTemplate.SceneTemplateAssetInspectorWindow+SnapshotTargetInfo targetInfo, UnityEditor.SerializedProperty thumbnailProperty) (at <4654f4f55d3c484985525a966206680d>:0)
UnityEditor.SceneTemplate.SceneTemplateAssetInspectorWindow+<>c__DisplayClass59_0.<MakeThumbnailField>b__4 () (at <4654f4f55d3c484985525a966206680d>:0)
UnityEngine.UIElements.Clickable.Invoke (UnityEngine.UIElements.EventBase evt) (at <1c96b7a3f7794c85b453037183b01ec4>:0)
UnityEngine.UIElements.Clickable.ProcessUpEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.Vector2 localPosition, System.Int32 pointerId) (at <1c96b7a3f7794c85b453037183b01ec4>:0)
UnityEngine.UIElements.Clickable.OnMouseUp (UnityEngine.UIElements.MouseUpEvent evt) (at <1c96b7a3f7794c85b453037183b01ec4>:0)
UnityEngine.UIElements.EventCallbackFunctor`1[TEventType].Invoke (UnityEngine.UIElements.EventBase evt) (at <1c96b7a3f7794c85b453037183b01ec4>:0)
UnityEngine.UIElements.EventCallbackRegistry.InvokeCallbacks (UnityEngine.UIElements.EventBase evt) (at <1c96b7a3f7794c85b453037183b01ec4>:0)
UnityEngine.UIElements.CallbackEventHandler.HandleEvent (UnityEngine.UIElements.EventBase evt) (at <1c96b7a3f7794c85b453037183b01ec4>:0)
UnityEngine.UIElements.TextElement.HandleEvent (UnityEngine.UIElements.EventBase evt) (at <1c96b7a3f7794c85b453037183b01ec4>:0)
UnityEngine.UIElements.CallbackEventHandler.HandleEventAtTargetPhase (UnityEngine.UIElements.EventBase evt) (at <1c96b7a3f7794c85b453037183b01ec4>:0)
UnityEngine.UIElements.MouseCaptureDispatchingStrategy.DispatchEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at <1c96b7a3f7794c85b453037183b01ec4>:0)
UnityEngine.UIElements.EventDispatcher.ApplyDispatchingStrategies (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel, System.Boolean imguiEventIsInitiallyUsed) (at <1c96b7a3f7794c85b453037183b01ec4>:0)
UnityEngine.UIElements.EventDispatcher.ProcessEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at <1c96b7a3f7794c85b453037183b01ec4>:0)
UnityEngine.UIElements.EventDispatcher.ProcessEventQueue () (at <1c96b7a3f7794c85b453037183b01ec4>:0)
UnityEngine.UIElements.EventDispatcher.OpenGate () (at <1c96b7a3f7794c85b453037183b01ec4>:0)
UnityEngine.UIElements.EventDispatcherGate.Dispose () (at <1c96b7a3f7794c85b453037183b01ec4>:0)
UnityEngine.UIElements.EventDispatcher.ProcessEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at <1c96b7a3f7794c85b453037183b01ec4>:0)
UnityEngine.UIElements.EventDispatcher.Dispatch (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel, UnityEngine.UIElements.DispatchMode dispatchMode) (at <1c96b7a3f7794c85b453037183b01ec4>:0)
UnityEngine.UIElements.BaseVisualElementPanel.SendEvent (UnityEngine.UIElements.EventBase e, UnityEngine.UIElements.DispatchMode dispatchMode) (at <1c96b7a3f7794c85b453037183b01ec4>:0)
UnityEngine.UIElements.UIElementsUtility.DoDispatch (UnityEngine.UIElements.BaseVisualElementPanel panel) (at <1c96b7a3f7794c85b453037183b01ec4>:0)
UnityEngine.UIElements.UIElementsUtility.UnityEngine.UIElements.IUIElementsUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr, System.Boolean& eventHandled) (at <1c96b7a3f7794c85b453037183b01ec4>:0)
UnityEngine.UIElements.UIEventRegistration.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) (at <1c96b7a3f7794c85b453037183b01ec4>:0)
UnityEngine.UIElements.UIEventRegistration+<>c.<.cctor>b__1_2 (System.Int32 i, System.IntPtr ptr) (at <1c96b7a3f7794c85b453037183b01ec4>:0)
UnityEngine.GUIUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr, System.Boolean& result) (at <8dc944f25f58485085268129f1b088bf>:0)

2)
FileNotFoundException: Could not find editor resource Icons/SceneTemplate.png
UnityEditor.Experimental.EditorResources.Load[T] (System.String assetPath, System.Boolean isRequired) (at <70c42c992fa442f8aa9edcf3e9f7b431>:0)
UnityEditorInternal.InternalEditorUtility.FindIconForFile (System.String fileName) (at <70c42c992fa442f8aa9edcf3e9f7b431>:0)
UnityEditorInternal.InternalEditorUtility.GetIconForFile (System.String fileName) (at <70c42c992fa442f8aa9edcf3e9f7b431>:0)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)

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.