Search Issue Tracker

Won't Fix

Votes

2

Found in

2020.3.2f1

2021.1.0b12

2021.1.16f1

Issue ID

1358000

Regression

Yes

[UI] UGUI elements cause NullReferenceException in Play mode

uGUI

-

Reproduction steps:
1. Open user attached project
2. Open the "SampleScene" scene
3. Expand "Canvas" UI Object in a Hierarchy
4. Move "Panel" UI Object above the "Button" UI Object
5. Enter the Play mode

Expected result: Error doesn't occur in a Console window
Actual result: Error occurs in a Console window

Reproducible with: 2020.3.2f1, 2020.3.19f1, 2021.1.0b12, 2021.1.23f1
Not reproducible with: 2019.4.31f1, 2020.3.1f1, 2021.1.0a1, 2021.1.0b11, 2021.2.0a1, 2021.2.0b14, 2022.1.0a11

Error:
NullReferenceException: Object reference not set to an instance of an object
UnityEditor.PropertyEditor.DrawEditors (UnityEditor.Editor[] editors) (at /Users/bokken/buildslave/unity/build/Editor/Mono/Inspector/PropertyEditor.cs:1550)
UnityEditor.PropertyEditor.RebuildContentsContainers () (at /Users/bokken/buildslave/unity/build/Editor/Mono/Inspector/PropertyEditor.cs:804)
UnityEditor.InspectorWindow.RedrawFromNative () (at /Users/bokken/buildslave/unity/build/Editor/Mono/Inspector/InspectorWindow.cs:144)

Note:
If you can't get this error, try to add a new Panel in Canvas, move Panel into Button or move Button into Panel, and so on

  1. Resolution Note (2020.3.X):

    Won't fix as the issue is cosmetical in nature as it doesn't have any tangible side-effects and affects only one active Unity stream (2020.3)

Comments (4)

  1. smallbit

    Nov 04, 2021 07:17

    2020.3.21 still persists.

  2. Akhil-Raja

    Oct 10, 2021 13:36

    Also observed this in Unity 2020.3.20f1. Empty scene with a canvas and a few blank panels cause this issue.

  3. mattrdell

    Sep 26, 2021 13:48

    This issue is also happening in version 2020.2.0f1, causing a lot of grief.

Add comment

Log in to post comment