Search Issue Tracker

Fixed in 2021.1.X

Fixed in 2020.2.X

Votes

0

Found in

2020.2.0b2

Issue ID

1275071

Regression

Yes

[2D] Exception is thrown on Reimporting the Project in which the Tile Palette window was docked and New Palette was created

Scene Management

-

When a new Tile Palette is created with Tile Palette window docked in the Editor and then the project is re-imported then ArgumentNullException appears in the console, Refer attached video.

Steps to repro:
1. Create a new Project with 2D Template
2. Window > 2D > Tile Palette > Docked
3. Create a New Tile Palette
4. Reimport the Project

Actual Result:
ArgumentNullException is thrown on Reimporting the Project if the Tile Palette window docked and New Palette created.

Expected Result:
Projet is reimported without any exception even if the Tile Palette window was docked and New Palette was created

Reproducible in:
2020.2.0b2 with Package version 1.0.0

Working fine in
2020.2.0b1, 2020.1.4f1 with Package version 1.0.0

Environment:
Occurring on Windows 10 & macOS 10.15.

Stack trace:
ArgumentNullException: Value cannot be null.
Parameter name: collection
System.Collections.Generic.HashSet`1[T]..ctor (System.Collections.Generic.IEnumerable`1[T] collection, System.Collections.Generic.IEqualityComparer`1[T] comparer) (at <351e49e2a5bf4fd6beabb458ce2255f3>:0)
System.Collections.Generic.HashSet`1[T]..ctor (System.Collections.Generic.IEnumerable`1[T] collection) (at <351e49e2a5bf4fd6beabb458ce2255f3>:0)
UnityEditor.PropertyEditor.OnPrefabInstanceUnpacked (UnityEngine.GameObject unpackedPrefabInstance) (at <3d7c86b365634083bceadac5c7f36490>:0)
UnityEditor.PrefabUtility.UnpackPrefabInstance (UnityEngine.GameObject instanceRoot, UnityEditor.PrefabUnpackMode unpackMode, UnityEditor.InteractionMode action) (at <3d7c86b365634083bceadac5c7f36490>:0)
UnityEditor.Tilemaps.GridPaintPaletteWindow.ResetPreviewInstance () (at F:/build1/2020.2.0b2/Editor/Data/Resources/PackageManager/BuiltInPackages/com.unity.2d.tilemap/Editor/GridPaintPaletteWindow.cs:556)
UnityEditor.Tilemaps.GridPaintPaletteWindow.InitPreviewUtility () (at F:/build1/2020.2.0b2/Editor/Data/Resources/PackageManager/BuiltInPackages/com.unity.2d.tilemap/Editor/GridPaintPaletteWindow.cs:618)
UnityEditor.Tilemaps.GridPaintPaletteWindow.get_previewUtility () (at F:/build1/2020.2.0b2/Editor/Data/Resources/PackageManager/BuiltInPackages/com.unity.2d.tilemap/Editor/GridPaintPaletteWindow.cs:423)
UnityEditor.Tilemaps.GridPaintPaletteClipboard.get_previewUtility () (at F:/build1/2020.2.0b2/Editor/Data/Resources/PackageManager/BuiltInPackages/com.unity.2d.tilemap/Editor/GridPaintPaletteClipboard.cs:70)
UnityEditor.Tilemaps.GridPaintPaletteClipboard.OnViewSizeChanged (UnityEngine.Rect oldSize, UnityEngine.Rect newSize) (at F:/build1/2020.2.0b2/Editor/Data/Resources/PackageManager/BuiltInPackages/com.unity.2d.tilemap/Editor/GridPaintPaletteClipboard.cs:403)
UnityEditor.Tilemaps.GridPaintPaletteClipboard.set_guiRect (UnityEngine.Rect value) (at F:/build1/2020.2.0b2/Editor/Data/Resources/PackageManager/BuiltInPackages/com.unity.2d.tilemap/Editor/GridPaintPaletteClipboard.cs:46)
UnityEditor.Tilemaps.GridPaintPaletteWindow.OnClipboardGUI (UnityEngine.Rect position) (at F:/build1/2020.2.0b2/Editor/Data/Resources/PackageManager/BuiltInPackages/com.unity.2d.tilemap/Editor/GridPaintPaletteWindow.cs:1213)
UnityEditor.Tilemaps.GridPaintPaletteWindow.OnGUI () (at F:/build1/2020.2.0b2/Editor/Data/Resources/PackageManager/BuiltInPackages/com.unity.2d.tilemap/Editor/GridPaintPaletteWindow.cs:486)
UnityEditor.HostView.InvokeOnGUI (UnityEngine.Rect onGUIPosition, UnityEngine.Rect viewRect) (at <3d7c86b365634083bceadac5c7f36490>:0)
UnityEditor.DockArea.DrawView (UnityEngine.Rect viewRect, UnityEngine.Rect dockAreaRect) (at <3d7c86b365634083bceadac5c7f36490>:0)
UnityEditor.DockArea.OldOnGUI () (at <3d7c86b365634083bceadac5c7f36490>:0)
UnityEngine.UIElements.IMGUIContainer.DoOnGUI (UnityEngine.Event evt, UnityEngine.Matrix4x4 parentTransform, UnityEngine.Rect clippingRect, System.Boolean isComputingLayout, UnityEngine.Rect layoutSize, System.Action onGUIHandler, System.Boolean canAffectFocus) (at <25b3b10f7ceb493e97ab16f983c3ca81>:0)
UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, UnityEngine.Matrix4x4 worldTransform, UnityEngine.Rect clippingRect, System.Action onGUIHandler, System.Boolean canAffectFocus) (at <25b3b10f7ceb493e97ab16f983c3ca81>:0)
UnityEngine.UIElements.IMGUIContainer.DoIMGUIRepaint () (at <25b3b10f7ceb493e97ab16f983c3ca81>:0)
UnityEngine.UIElements.UIR.RenderChainCommand.ExecuteNonDrawMesh (UnityEngine.UIElements.UIR.DrawParams drawParams, System.Single pixelsPerPoint, System.Exception& immediateException) (at <25b3b10f7ceb493e97ab16f983c3ca81>:0)
Rethrow as ImmediateModeException
UnityEngine.UIElements.UIR.RenderChain.Render () (at <25b3b10f7ceb493e97ab16f983c3ca81>:0)
UnityEngine.UIElements.UIRRepaintUpdater.Update () (at <25b3b10f7ceb493e97ab16f983c3ca81>:0)
UnityEngine.UIElements.VisualTreeUpdater.UpdateVisualTreePhase (UnityEngine.UIElements.VisualTreeUpdatePhase phase) (at <25b3b10f7ceb493e97ab16f983c3ca81>:0)
UnityEngine.UIElements.Panel.UpdateForRepaint () (at <25b3b10f7ceb493e97ab16f983c3ca81>:0)
UnityEngine.UIElements.Panel.Repaint (UnityEngine.Event e) (at <25b3b10f7ceb493e97ab16f983c3ca81>:0)
UnityEngine.UIElements.UIElementsUtility.DoDispatch (UnityEngine.UIElements.BaseVisualElementPanel panel) (at <25b3b10f7ceb493e97ab16f983c3ca81>:0)
UnityEngine.UIElements.UIElementsUtility.UnityEngine.UIElements.IUIElementsUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr, System.Boolean& eventHandled) (at <25b3b10f7ceb493e97ab16f983c3ca81>:0)
UnityEngine.UIElements.UIEventRegistration.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) (at <25b3b10f7ceb493e97ab16f983c3ca81>:0)
UnityEngine.UIElements.UIEventRegistration+<>c.<.cctor>b__1_2 (System.Int32 i, System.IntPtr ptr) (at <25b3b10f7ceb493e97ab16f983c3ca81>:0)
UnityEngine.GUIUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr, System.Boolean& result) (at

Comments (1)

  1. JDSherbert

    Aug 02, 2021 23:53

    Unity 2020.1.3f1
    I managed to fix the issue by replacing the line of code at line cs817 to this:

    if(clipboardView) DestroyImmediate(clipboardView);

    Hope this helps.

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.