Skip to content

Commit

Permalink
Fix NRE in EditorActiveProfileChangeHandler (#757)
Browse files Browse the repository at this point in the history
NREs were thrown in the handler if no active profile was set.
  • Loading branch information
FejZa committed Jan 15, 2021
1 parent 9fff53a commit beb24f6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Editor/EditorActiveProfileChangeHandler.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) XRTK. All rights reserved.
// Copyright (c) XRTK. All rights reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.

using UnityEditor;
Expand All @@ -18,7 +18,7 @@ static EditorActiveProfileChangeHandler()

private static void EditorApplication_hierarchyChanged()
{
if (!MixedRealityToolkit.Instance.IsNull())
if (!(MixedRealityToolkit.Instance.IsNull() || MixedRealityToolkit.Instance.ActiveProfile.IsNull()))
{
if (MixedRealityToolkit.Instance.ActiveProfile.IsInputSystemEnabled &&
Utilities.InputMappingAxisUtility.CheckUnityInputManagerMappings(Utilities.ControllerMappingUtilities.UnityInputManagerAxes))
Expand All @@ -33,4 +33,4 @@ private static void EditorApplication_hierarchyChanged()
}
}
}
}
}

0 comments on commit beb24f6

Please sign in to comment.