fix crash if we try to get the hostkey when not connected!!

instead of checking connected, ssh_is_connected(session) == 0
This commit is contained in:
neon443 committed 2025-08-04 13:24:12 +01:00
1 parent 5f0df4f564
commit 3b50139c97
1 file changed
+1 -1
+1 -1
View File
@@ -47,7 +47,7 @@ class SSHHandler: @unchecked Sendable, ObservableObject {
} }
func getHostkey() -> String? { func getHostkey() -> String? {
guard connected else { return nil } guard ssh_is_connected(session) == 0 else { return nil }
var hostkey: ssh_key? var hostkey: ssh_key?
ssh_get_server_publickey(session, &hostkey) ssh_get_server_publickey(session, &hostkey)
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.