Skip to content

Commit 0c1e3bb

Browse files
Stephen HodgsonStephen Hodgson
authored andcommitted
EditorGUILayoutExtensions: Fixes error when we want to display a blank field.
1 parent 0303309 commit 0c1e3bb

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Assets/HoloToolkit/Utilities/Editor/EditorGUILayoutExtensions.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,12 @@ public static T ObjectField<T>(GUIContent guiContent, T value, bool allowSceneOb
4444
{
4545
object objValue = value;
4646

47+
if (objValue == null)
48+
{
49+
// We want to return null so we can dispay our blank field.
50+
return (T)objValue;
51+
}
52+
4753
Type valueType = objValue.GetType();
4854
if (valueType == typeof(Material))
4955
{

0 commit comments

Comments
 (0)