Skip to content

Commit

Permalink
Fixed NullReferenceException on Unity 2022.2+ when closing inspected …
Browse files Browse the repository at this point in the history
…asset's Inspect+ window
  • Loading branch information
yasirkula committed Nov 19, 2024
1 parent 6f4bff7 commit 29cc077
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Plugins/InspectPlus/Editor/InspectPlusWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1907,7 +1907,9 @@ private void SetInspectorAssetDrawer( Editor assetDrawer )

if( inspectorAssetDrawer )
{
#if UNITY_2019_2_OR_NEWER
#if UNITY_2022_2_OR_NEWER
inspectorAssetDrawer.DiscardChanges();
#elif UNITY_2019_2_OR_NEWER
// On newer Unity versions, unfortunately the Apply/Revert dialog isn't displayed automatically when we stop inspecting an asset in Inspect+,
// so we must show the Apply/Revert dialog manually and as long as user presses Cancel, continue showing the dialog
bool applyRevertFinished;
Expand Down

0 comments on commit 29cc077

Please sign in to comment.