Skip to content

Commit f215910

Browse files
committed
Add #if UNITY_EDITOR
1 parent 4e97724 commit f215910

1 file changed

Lines changed: 4 additions & 11 deletions

File tree

org.mixedrealitytoolkit.core/Tests/TestUtilities/PackageValidator.cs

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
// Copyright (c) Mixed Reality Toolkit Contributors
22
// Licensed under the BSD 3-Clause
33

4-
// Disable "missing XML comment" warning for tests. While nice to have, this documentation is not required.
5-
#pragma warning disable CS1591
6-
#if HAS_ASSET_STORE_VALIDATION
4+
#if HAS_ASSET_STORE_VALIDATION && UNITY_EDITOR
75

86
using System;
97
using System.Collections.Generic;
@@ -26,12 +24,7 @@ public static class PackageValidator
2624
/// </exception>
2725
public static PackageValidatorResults Validate(string packageName)
2826
{
29-
PackageInfo info = UpmPackageInfo(packageName);
30-
if (info == null)
31-
{
32-
throw new ArgumentException($"No package found with name \"{packageName}\"");
33-
}
34-
27+
PackageInfo info = UpmPackageInfo(packageName) ?? throw new ArgumentException($"No package found with name \"{packageName}\"");
3528
string packageId = $"{info.name}@{info.version}";
3629
ValidationSuite.ValidatePackage(packageId, ValidationType.AssetStore);
3730

@@ -70,5 +63,5 @@ private static PackageInfo[] UpmListOffline(string packageIdOrName = null)
7063
}
7164
}
7265
}
73-
#endif // HAS_ASSET_STORE_VALIDATION
74-
#pragma warning restore CS1591
66+
67+
#endif // HAS_ASSET_STORE_VALIDATION && UNITY_EDITOR

0 commit comments

Comments
 (0)