Search Issue Tracker

Won't Fix

Votes

0

Found in

2018.4

2019.2.11f1

2019.3

2020.1

2020.2

Issue ID

1231054

Regression

Yes

A null reference exception is thrown when trying to access EditorStyles.miniTextField property during script recompilation

IMGUI

-

How to reproduce:
1. Open the attached 'project-1231054.zip' project
2. Select the 'TestEditor' in the Hierarchy window
3. Open the 'TestScript' and make a code change to trigger script recompilation
4. Return to the Editor and observe the Console window

Expected result: no exceptions are thrown
Actual result: an exception is thrown

Reproducible with: 2018.4.20f1, 2019.3.8f1, 2020.1.0b4, 2020.2.0a5
Not reproducible with: 2017.4.38f1

Thrown exception:
NullReferenceException: Object reference not set to an instance of an object
UnityEditor.EditorStyles.get_miniTextField () (at <b5e754b172ef4f1b82e78043441796df>:0)

  1. Resolution Note:

    EditorStyles are invoked at a time in the script compilation pipeline where the Styles are not yet built. It would be risky and tedious to alter the current design and build the styles during the script compilation. Hence at this point we may not be able to fix this issue

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.