Skip to content

Commit 420f335

Browse files
authored
Don't crash the application if the auto-update check fails (#316)
1 parent f266bff commit 420f335

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

LightBulb/ViewModels/MainViewModel.cs

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,16 @@ UpdateService updateService
2525
TimeSpan.FromHours(3),
2626
async () =>
2727
{
28-
var updateVersion = await updateService.CheckForUpdatesAsync();
29-
if (updateVersion is not null)
30-
await updateService.PrepareUpdateAsync(updateVersion);
28+
try
29+
{
30+
var updateVersion = await updateService.CheckForUpdatesAsync();
31+
if (updateVersion is not null)
32+
await updateService.PrepareUpdateAsync(updateVersion);
33+
}
34+
catch
35+
{
36+
// Failure to update shouldn't crash the application
37+
}
3138
}
3239
);
3340

0 commit comments

Comments
 (0)