diff --git a/v2rayN/v2rayN.Desktop/App.axaml.cs b/v2rayN/v2rayN.Desktop/App.axaml.cs index b797c90b..7626edfd 100644 --- a/v2rayN/v2rayN.Desktop/App.axaml.cs +++ b/v2rayN/v2rayN.Desktop/App.axaml.cs @@ -43,7 +43,7 @@ public partial class App : Application { if (e.ExceptionObject != null) { - Logging.SaveLog("CurrentDomain_UnhandledException", (Exception)e.ExceptionObject!); + Logging.SaveLog("CurrentDomain_UnhandledException", (Exception)e.ExceptionObject); } } diff --git a/v2rayN/v2rayN.Desktop/Views/ClashConnectionsView.axaml.cs b/v2rayN/v2rayN.Desktop/Views/ClashConnectionsView.axaml.cs index b4426c29..c39724eb 100644 --- a/v2rayN/v2rayN.Desktop/Views/ClashConnectionsView.axaml.cs +++ b/v2rayN/v2rayN.Desktop/Views/ClashConnectionsView.axaml.cs @@ -52,9 +52,16 @@ public partial class ClashConnectionsView : ReactiveUserControl private void AutofitColumnWidth() { - foreach (var it in lstProfiles.Columns) + try { - it.Width = new DataGridLength(1, DataGridLengthUnitType.Auto); + foreach (var it in lstProfiles.Columns) + { + it.Width = new DataGridLength(1, DataGridLengthUnitType.Auto); + } + } + catch (Exception ex) + { + Logging.SaveLog("ProfilesView", ex); } } diff --git a/v2rayN/v2rayN/App.xaml.cs b/v2rayN/v2rayN/App.xaml.cs index 86518fa0..0a282733 100644 --- a/v2rayN/v2rayN/App.xaml.cs +++ b/v2rayN/v2rayN/App.xaml.cs @@ -56,7 +56,7 @@ public partial class App : Application { if (e.ExceptionObject != null) { - Logging.SaveLog("CurrentDomain_UnhandledException", (Exception)e.ExceptionObject!); + Logging.SaveLog("CurrentDomain_UnhandledException", (Exception)e.ExceptionObject); } } diff --git a/v2rayN/v2rayN/Views/ClashConnectionsView.xaml.cs b/v2rayN/v2rayN/Views/ClashConnectionsView.xaml.cs index 54f3adee..18b97d2a 100644 --- a/v2rayN/v2rayN/Views/ClashConnectionsView.xaml.cs +++ b/v2rayN/v2rayN/Views/ClashConnectionsView.xaml.cs @@ -55,9 +55,16 @@ public partial class ClashConnectionsView private void AutofitColumnWidth() { - foreach (var it in lstConnections.Columns) + try { - it.Width = new DataGridLength(1, DataGridLengthUnitType.Auto); + foreach (var it in lstConnections.Columns) + { + it.Width = new DataGridLength(1, DataGridLengthUnitType.Auto); + } + } + catch (Exception ex) + { + Logging.SaveLog("ClashConnectionsView", ex); } } diff --git a/v2rayN/v2rayN/Views/ProfilesView.xaml.cs b/v2rayN/v2rayN/Views/ProfilesView.xaml.cs index daefd332..3501747e 100644 --- a/v2rayN/v2rayN/Views/ProfilesView.xaml.cs +++ b/v2rayN/v2rayN/Views/ProfilesView.xaml.cs @@ -323,9 +323,16 @@ public partial class ProfilesView private void AutofitColumnWidth() { - foreach (var it in lstProfiles.Columns) + try { - it.Width = new DataGridLength(1, DataGridLengthUnitType.Auto); + foreach (var it in lstProfiles.Columns) + { + it.Width = new DataGridLength(1, DataGridLengthUnitType.Auto); + } + } + catch (Exception ex) + { + Logging.SaveLog("ProfilesView", ex); } }