From 3b50139c9752b6193298695c26825d3cb6df6dad Mon Sep 17 00:00:00 2001 From: neon443 <69979447+neon443@users.noreply.github.com> Date: Mon, 4 Aug 2025 13:24:04 +0100 Subject: [PATCH] fix crash if we try to get the hostkey when not connected!! instead of checking connected, ssh_is_connected(session) == 0 --- ShhShell/SSH/SSHHandler.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ShhShell/SSH/SSHHandler.swift b/ShhShell/SSH/SSHHandler.swift index 635ab37..c0120f4 100644 --- a/ShhShell/SSH/SSHHandler.swift +++ b/ShhShell/SSH/SSHHandler.swift @@ -47,7 +47,7 @@ class SSHHandler: @unchecked Sendable, ObservableObject { } func getHostkey() -> String? { - guard connected else { return nil } + guard ssh_is_connected(session) == 0 else { return nil } var hostkey: ssh_key? ssh_get_server_publickey(session, &hostkey)