Search Issue Tracker

Fixed in 2020.1



Found in





Issue ID




Error is thrown when entering the Play Mode while Inspector and Tile Palette are opened and GameObject with Grid is selected



How to reproduce:
1. Open the attached "1287664" project
2. Open the Scene "SampleScene"
3. Make sure the Inspector window is visible (Window->General->Inspector)
4. Make sure the Tile Palette window is turned on anywhere (Window->2D->Tile Palette), doesn't have to be visible
5. Select the "Grid" GameObject
6. Keep entering and exiting the Play Mode until an error is thrown in the console (might take tens of tries for the error to appear)

Expected results: No errors are thrown when entering the Play Mode
Actual results: The "NullReferenceException: Object reference not set to an instance of an object" error is thrown when entering the Play Mode

Reproducible with: 2020.1.10f1, 2020.1.12f1, 2020.2.0b8, 2020.2.0b10, 2021.1.0a3
Not reproducible with: 2018.4.28f1, 2019.4.14f1, 2020.1.9f1, 2020.2.0a1, 2020.2.0b7

- A Palette has to be selected in the Tile Palette window but the Palette can be empty
- This issue has been introduced from the case 1271740 fix (same error except it points to a different line in the script and slightly different requirements to reproduce the issue)
- The full error:
NullReferenceException: Object reference not set to an instance of an object
UnityEditor.GameObjectInspector.ClearPreviewCache () (at <859685c8158c480a8d135de9619162c9>:0)
UnityEditor.GameObjectInspector.ReloadPreviewInstances () (at <859685c8158c480a8d135de9619162c9>:0)
UnityEditor.GameObjectInspector.OnForceReloadInspector () (at <859685c8158c480a8d135de9619162c9>:0)
UnityEditor.Tilemaps.GridPaintPaletteClipboard:OnDisable() (at C:/Program Files/2021.1/2021.1.0a1_eff81b68729d/Editor/Data/Resources/PackageManager/BuiltInPackages/com.unity.2d.tilemap/Editor/GridPaintPaletteClipboard.cs:347)

  1. Response avatar

    Resolution Note (fix version 2020.1):

    A fix for this issue will be available on Unity 2021.1.0a7 and above

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.