Skip to content

Commit

Permalink
Don't crash the application if the auto-update check fails (#316)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tyrrrz authored Jun 4, 2024
1 parent f266bff commit 420f335
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions LightBulb/ViewModels/MainViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,16 @@ UpdateService updateService
TimeSpan.FromHours(3),
async () =>
{
var updateVersion = await updateService.CheckForUpdatesAsync();
if (updateVersion is not null)
await updateService.PrepareUpdateAsync(updateVersion);
try
{
var updateVersion = await updateService.CheckForUpdatesAsync();
if (updateVersion is not null)
await updateService.PrepareUpdateAsync(updateVersion);
}
catch
{
// Failure to update shouldn't crash the application
}
}
);

Expand Down

0 comments on commit 420f335

Please sign in to comment.