Skip to content

Commit

Permalink
Fix an exception in HighlightModule that can occur if EditorXR tries …
Browse files Browse the repository at this point in the history
…to set up right after a domain reload
  • Loading branch information
mtschoen-unity committed Aug 31, 2020
1 parent 65ae164 commit 3388fc2
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion Runtime/Scripts/Modules/HighlightModule/HighlightModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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; }
}

Expand Down

0 comments on commit 3388fc2

Please sign in to comment.