Skip to content

Commit d6074d8

Browse files
committed
check if platforms folder exists, #build
1 parent f5d468b commit d6074d8

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Diff for: UnityLauncherPro/GetUnityInstallations.cs

+4-2
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public static UnityInstallation[] Scan()
5050

5151
// TEST get platforms, NOTE if this is slow, do it later, or skip for commandline
5252
var platforms = GetPlatforms(dataFolder);
53-
unity.Platforms = string.Join(", ", platforms);
53+
if (platforms != null) unity.Platforms = string.Join(", ", platforms);
5454

5555
// add to list, if not there yet NOTE should notify that there are 2 same versions..? this might happen with preview builds..
5656
if (results.Contains(unity) == true)
@@ -73,7 +73,9 @@ public static UnityInstallation[] Scan()
7373
static string[] GetPlatforms(string dataFolder)
7474
{
7575
// get all folders inside
76-
var directories = Directory.GetDirectories(Path.Combine(dataFolder, "PlaybackEngines"));
76+
var platformFolder = Path.Combine(dataFolder, "PlaybackEngines");
77+
if (Directory.Exists(platformFolder) == false) return null;
78+
var directories = Directory.GetDirectories(platformFolder);
7779
// TODO get all platform names from those folders
7880
// TODO get platform foldername only
7981
for (int i = 0; i < directories.Length; i++)

0 commit comments

Comments
 (0)