You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 30, 2020. It is now read-only.
Fixed a nullref when adding a new effect in a larger scene.
Adding a new effect can cause an infrequent nullreference: https://streamable.com/bk03b. Only seems to happen with large scenes, and only the first effect you add. The whole stacktrace is:
```
NullReferenceException: (null)
UnityEditor.SerializedObject..ctor (UnityEngine.Object obj) (at C:/buildslave/unity/build/Editor/Mono/SerializedObject.cs:10)
UnityEditor.Rendering.PostProcessing.PostProcessEffectBaseEditor.Init (UnityEngine.Rendering.PostProcessing.PostProcessEffectSettings target, UnityEditor.Editor inspector) (at Assets/Plugins/packages/PostProcessing/Editor/PostProcessEffectBaseEditor.cs:32)
UnityEditor.Rendering.PostProcessing.EffectListEditor.CreateEditor (UnityEngine.Rendering.PostProcessing.PostProcessEffectSettings settings, UnityEditor.SerializedProperty property, Int32 index) (at Assets/Plugins/packages/PostProcessing/Editor/EffectListEditor.cs:86)
UnityEditor.Rendering.PostProcessing.EffectListEditor.AddEffectOverride (System.Type type) (at Assets/Plugins/packages/PostProcessing/Editor/EffectListEditor.cs:231)
UnityEditor.Rendering.PostProcessing.EffectListEditor+<OnGUI>c__AnonStorey1.<>m__0 () (at Assets/Plugins/packages/PostProcessing/Editor/EffectListEditor.cs:189)
UnityEditor.GenericMenu.CatchMenu (System.Object userData, System.String[] options, Int32 selected) (at C:/buildslave/unity/build/artifacts/generated/common/editor/GenericMenuBindings.gen.cs:121)
```
The AddEffectOverride method calls AssetDatabase.SaveAssets, which causes the effect to be nullified. Probably there is some reloading going on?
https://streamable.com/nlujr
Moved the SaveAssets to the end of the method, added a comment to explain what and why.
0 commit comments