From 82b366cd9b0aef8d3e44f86ab968e60c75bdb261 Mon Sep 17 00:00:00 2001 From: 2dust <31833384+2dust@users.noreply.github.com> Date: Wed, 7 May 2025 14:28:55 +0800 Subject: [PATCH] Fix https://github.com/2dust/v2rayN/issues/7244 --- v2rayN/v2rayN.Desktop/App.axaml.cs | 2 +- .../Views/ClashConnectionsView.axaml.cs | 11 +++++++++-- v2rayN/v2rayN.Desktop/Views/ProfilesView.axaml.cs | 11 +++++++++-- v2rayN/v2rayN/App.xaml.cs | 2 +- v2rayN/v2rayN/Views/ClashConnectionsView.xaml.cs | 11 +++++++++-- v2rayN/v2rayN/Views/ProfilesView.xaml.cs | 11 +++++++++-- 6 files changed, 38 insertions(+), 10 deletions(-) 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); } }