Skip to content

Commit

Permalink
Add null pointer check before disposing windowCloser #46
Browse files Browse the repository at this point in the history
This should prevent Switcheroo from crashing when shutting down windows
without having had the Switcheroo window opened
  • Loading branch information
kvakulo committed Jun 16, 2015
1 parent 49c6ab9 commit 54d1399
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Switcheroo/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,12 @@ private void Switch()

private void HideWindow()
{
_windowCloser.Dispose();
if (_windowCloser != null)
{
_windowCloser.Dispose();
_windowCloser = null;
}

Opacity = 0;

// Avoid flicker by delaying the "Hide" a bit. This makes sure
Expand Down

0 comments on commit 54d1399

Please sign in to comment.