Skip to content

Commit dc0454b

Browse files
authored
Merge pull request #3570 from Flow-Launcher/exitting_null
Fix main window null when checking exiting
2 parents 087a45c + 8aae92e commit dc0454b

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

Flow.Launcher/App.xaml.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public partial class App : IDisposable, ISingleInstanceApp
3232
#region Public Properties
3333

3434
public static IPublicAPI API { get; private set; }
35-
public static bool Exiting => _mainWindow.CanClose;
35+
public static bool LoadingOrExiting => _mainWindow == null || _mainWindow.CanClose;
3636

3737
#endregion
3838

Flow.Launcher/SettingWindow.xaml.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ private void OnClosed(object sender, EventArgs e)
8282
_viewModel.PropertyChanged -= ViewModel_PropertyChanged;
8383

8484
// If app is exiting, settings save is not needed because main window closing event will handle this
85-
if (App.Exiting) return;
85+
if (App.LoadingOrExiting) return;
8686
// Save settings when window is closed
8787
_settings.Save();
8888
App.API.SavePluginSettings();

Flow.Launcher/ViewModel/MainViewModel.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1729,7 +1729,7 @@ public bool ShouldIgnoreHotkeys()
17291729
public void Show()
17301730
{
17311731
// When application is exiting, we should not show the main window
1732-
if (App.Exiting) return;
1732+
if (App.LoadingOrExiting) return;
17331733

17341734
// When application is exiting, the Application.Current will be null
17351735
Application.Current?.Dispatcher.Invoke(() =>

Flow.Launcher/WelcomeWindow.xaml.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ private void ContentFrame_Loaded(object sender, RoutedEventArgs e)
9696
private void Window_Closed(object sender, EventArgs e)
9797
{
9898
// If app is exiting, settings save is not needed because main window closing event will handle this
99-
if (App.Exiting) return;
99+
if (App.LoadingOrExiting) return;
100100
// Save settings when window is closed
101101
_settings.Save();
102102
}

0 commit comments

Comments
 (0)