From 13c8bf5f19c39ff9697d668910d2c27833392400 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Burak=20Kaan=20K=C3=B6se?= Date: Sat, 14 Sep 2024 01:33:35 +0200 Subject: [PATCH] Prevent crashes on resume due to connectivity issues. --- Wino.Mail/App.xaml.cs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/Wino.Mail/App.xaml.cs b/Wino.Mail/App.xaml.cs index 3a23c5dc..5e0c4156 100644 --- a/Wino.Mail/App.xaml.cs +++ b/Wino.Mail/App.xaml.cs @@ -187,7 +187,18 @@ namespace Wino // We must restore it. // Server might be running already, but re-launching it will trigger a new connection attempt. - await _appServiceConnectionManager.ConnectAsync(); + try + { + await _appServiceConnectionManager.ConnectAsync(); + } + catch (OperationCanceledException) + { + // Ignore + } + catch (Exception ex) + { + Log.Error(ex, "Failed to connect to server after resuming the app."); + } } private void OnSuspending(object sender, SuspendingEventArgs e)