Search Issue Tracker

Fixed in 2021.1.X

Fixed in 2019.4.X, 2020.1.X, 2020.2.X

Votes

0

Found in

2019.1.0a12

2019.4

2019.4.9f1

2020.1

2020.2

Issue ID

1274633

Regression

Yes

NullReferenceException is thrown when calling AssetDatabase.OpenAsset after reopening Unity with the Project tab unfocused

Asset - Database

-

How to reproduce:
1. Create a new project
2. Set the Layout to 'Default' (Window -> Layouts -> Default)
3. Inside the Assets directory create a subfolder 'Editor' and paste the attached Script (OpenFolderTest.cs) inside it
4. Switch from the Project tab to the Console tab
5. Close and reopen the Editor
6. Without switching to the Project tab click 'Open Test' -> 'Run Open Folder Test' located at the top of the Editor

Expected result: the 'Editor' folder is selected (selection can be seen in the Inspector window)
Actual result: NullReferenceException is thrown (but the selection can still be seen)

Reproducible with: 2019.1.0a12, 2019.4.9f1, 2020.1.4f1, 2020.2.0b1
Not reproducible with: 2018.4.27f1, 2019.1.0a11

Workaround:
After reopening the Editor at step 5 switch to the Project tab for a moment (it's not necessary to stay in the Project tab after that)

Notes:
The issue does not occur when the Project window is closed

  1. Resolution Note (fix version 2021.1):

    Fixed in 2021.1.0a1

  2. Resolution Note (fix version 2020.2):

    Fixed in 2020.2.0b7

  3. Resolution Note (fix version 2020.1):

    Fixed in 2020.1.9f1

  4. Resolution Note (fix version 2019.4):

    Fixed in 2019.4.13f1

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.