From 3388fc2261ffc449bb4147b0e6aa6720d5d6ace3 Mon Sep 17 00:00:00 2001 From: Matt Schoen Date: Mon, 31 Aug 2020 16:50:46 -0700 Subject: [PATCH] Fix an exception in HighlightModule that can occur if EditorXR tries to set up right after a domain reload --- .../Scripts/Modules/HighlightModule/HighlightModule.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Runtime/Scripts/Modules/HighlightModule/HighlightModule.cs b/Runtime/Scripts/Modules/HighlightModule/HighlightModule.cs index b9b6136dd..0c9e8ec11 100644 --- a/Runtime/Scripts/Modules/HighlightModule/HighlightModule.cs +++ b/Runtime/Scripts/Modules/HighlightModule/HighlightModule.cs @@ -58,7 +58,13 @@ struct HighlightData public Color highlightColor { - get { return m_RayHighlightMaterialCopy.GetVector("_Color"); } + get + { + if (m_RayHighlightMaterialCopy == null) + return default; + + return m_RayHighlightMaterialCopy.GetVector("_Color"); + } set { m_RayHighlightMaterialCopy.color = value; } }