Skip to content

Commit b43226b

Browse files
committed
Bug Fix: Exiting application crashed because it didn't check if sshClient was instantiated
1 parent b05a114 commit b43226b

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

Background-Terminal/MainWindow.xaml.cs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -671,8 +671,14 @@ private void MinimizeButton_Click(object sender, RoutedEventArgs e)
671671

672672
private void ExitButton_Click(object sender, RoutedEventArgs e)
673673
{
674-
_sshClient.Disconnect();
675-
_sshClient.Dispose();
674+
if (_sshClient != null)
675+
{
676+
if (_sshClient.IsConnected)
677+
_sshClient.Disconnect();
678+
679+
_sshClient.Dispose();
680+
}
681+
676682
_process.Kill();
677683

678684
Close();

0 commit comments

Comments
 (0)