Skip to content

Commit 48e4aab

Browse files
cast strings to unity versions and check match for null array
1 parent 869b396 commit 48e4aab

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

UnitySetup/UnitySetup.psm1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ class UnitySetupInstance {
5757

5858
if ( Test-Path $ivy.FullName ) {
5959
[xml]$xmlDoc = Get-Content $ivy.FullName
60-
$version = $xmlDoc.'ivy-module'.info.unityVersion
60+
$version = [UnityVersion]$xmlDoc.'ivy-module'.info.unityVersion
6161
}
6262
else {
6363
# No ivy files found, so search the new modules.json for the version
@@ -66,8 +66,8 @@ class UnitySetupInstance {
6666
foreach ( $module in $modules ) {
6767
$module.DownloadUrl -match "(\d+)\.(\d+)\.(\d+)([fpb])(\d+)" | Out-Null
6868

69-
if ( $Matches[0] -ne $null ) {
70-
$version = $Matches[0]
69+
if ( $Matches -ne $null ) {
70+
$version = [UnityVersion]$Matches[0]
7171
break
7272
}
7373
}

0 commit comments

Comments
 (0)