Skip to content

Commit 75307d5

Browse files
committed
[Win] Fix returning default instead of Task leading to null reference exception
1 parent 3969c9e commit 75307d5

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

sttz.InstallUnity/Installer/Platforms/WindowsPlatform.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,8 @@ public Task<Installation> CompleteInstall(bool aborted, CancellationToken cancel
9898
if (!aborted)
9999
{
100100
var executable = Path.Combine(installationPaths, "Editor", "Unity.exe");
101-
if (!File.Exists(executable)) return default;
101+
if (!File.Exists(executable))
102+
throw new Exception($"Unity exe not found at expected path after installation: {executable}");
102103

103104
var installation = new Installation()
104105
{
@@ -113,7 +114,7 @@ public Task<Installation> CompleteInstall(bool aborted, CancellationToken cancel
113114
}
114115
else
115116
{
116-
return default;
117+
return Task.FromResult<Installation>(null);
117118
}
118119
}
119120

0 commit comments

Comments
 (0)