Search Issue Tracker

Fixed in 2020.1.X

Votes

0

Found in

2020.1.10f1

2020.2.0b8

2021.1

2021.1.0a2

Issue ID

1287664

Regression

Yes

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

2D

-

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

Notes:
- 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

Comments (2)

  1. 4914c422e001b9c80b74ff69b48330be?d=mm

    randyleemaitland

    Apr 15, 2021 01:50

    I'm still seeing this too....

    NullReferenceException: Object reference not set to an instance of an object
    UnityEditor.GameObjectInspector.ClearPreviewCache () (at <c9b5231e365148a4bc210cc4e439206d>:0)
    UnityEditor.GameObjectInspector.OnDisable () (at <c9b5231e365148a4bc210cc4e439206d>:0)
    UnityEditor.Tilemaps.GridPaintPaletteClipboard:OnDisable() (at C:/Program Files/Unity/Hub/Editor/2020.3.3f1/Editor/Data/Resources/PackageManager/BuiltInPackages/com.unity.2d.tilemap/Editor/GridPaintPaletteClipboard.cs:347)

  2. Def2c8b39899fe76df448c74e9d87372?d=mm

    LordDarkenon

    Mar 21, 2021 19:02

    This is still an issue in 2020.3 LTS

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.