Search Issue Tracker

Fixed in 2019.3

Votes

1

Found in

2019.2.0b10

2019.3.0a5

2019.3.0a11

Issue ID

1171902

Regression

Yes

[Terrain] Throws NullReference Exception on adding Terrain component to GO when paint texture is selected

Terrain

-

Throws NullReference Exception on adding Terrain component to GO when paint texture is selected under paint terrain.

Steps to repro:
1. Create a new project.
2. Hierarchy > Right-click > Create Empty
3. Add Component > Terrain Collider > Terrain
4. Assign Terrain data and terrain asset
5. Hierarchy > GameObject > Terrain > Paint Terrain > Paint Texture

Actual Result:
NullReference exceptions are thrown.

Expected Result:
No exceptions are thrown in the console.

Reproducible in:
2019.3.0a11, 2019.3.0a5, 2019.2.0f1, 2019.2.0b10

Working Fine in:
2019.3.0a4, 2019.2.0b9, 2019.1.0f2

Environment:
Windows and Mac.

Stack Trace:
NullReferenceException: Object reference not set to an instance of an object
UnityEditor.Experimental.TerrainAPI.PaintTextureTool.OnInspectorGUI (UnityEngine.Terrain terrain, UnityEditor.Experimental.TerrainAPI.IOnInspectorGUI editContext) (at /Users/builduser/buildslave/unity/build/Modules/TerrainEditor/PaintTools/PaintTextureTool.cs:105)
UnityEditor.TerrainInspector.ShowPaint () (at /Users/builduser/buildslave/unity/build/Modules/TerrainEditor/TerrainInspector.cs:1499)
UnityEditor.TerrainInspector.OnInspectorGUI () (at /Users/builduser/buildslave/unity/build/Modules/TerrainEditor/TerrainInspector.cs:2000)
UnityEditor.UIElements.InspectorElement+<>c__DisplayClass53_0.<CreateIMGUIInspectorFromEditor>b__0 () (at /Users/builduser/buildslave/unity/build/Editor/Mono/Inspector/InspectorElement.cs:494)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)

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.