Skip to content

Commit 630ef7e

Browse files
authored
Merge pull request #3597 from Alexees/mrtk_checkOrderChange
Change order of checks
2 parents 7cf5d4a + 17fdb45 commit 630ef7e

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

Assets/MixedRealityToolkit/Services/MixedRealityToolkit.cs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -618,24 +618,24 @@ public bool RegisterService<T>(Type interfaceType, SupportedPlatforms supportedP
618618
return false;
619619
}
620620

621-
if (interfaceType == null)
621+
#if !UNITY_EDITOR
622+
if (!Application.platform.IsPlatformSupported(supportedPlatforms))
623+
#else
624+
if (!UnityEditor.EditorUserBuildSettings.activeBuildTarget.IsPlatformSupported(supportedPlatforms))
625+
#endif
622626
{
623-
Debug.LogError("Unable to register a service with a null concrete type.");
624627
return false;
625628
}
626629

627-
if (!typeof(IMixedRealityService).IsAssignableFrom(interfaceType))
630+
if (interfaceType == null)
628631
{
629-
Debug.LogError($"Unable to register the {interfaceType.Name} service. It does not implement {typeof(IMixedRealityService)}.");
632+
Debug.LogError("Unable to register a service with a null concrete type.");
630633
return false;
631634
}
632635

633-
#if !UNITY_EDITOR
634-
if (!Application.platform.IsPlatformSupported(supportedPlatforms))
635-
#else
636-
if (!UnityEditor.EditorUserBuildSettings.activeBuildTarget.IsPlatformSupported(supportedPlatforms))
637-
#endif
636+
if (!typeof(IMixedRealityService).IsAssignableFrom(interfaceType))
638637
{
638+
Debug.LogError($"Unable to register the {interfaceType.Name} service. It does not implement {typeof(IMixedRealityService)}.");
639639
return false;
640640
}
641641

0 commit comments

Comments
 (0)