diff --git a/ShhShell/Keys/Keypair.swift b/ShhShell/Keys/Keypair.swift index d175f60..9ff1d28 100644 --- a/ShhShell/Keys/Keypair.swift +++ b/ShhShell/Keys/Keypair.swift @@ -52,7 +52,12 @@ struct Keypair: KeypairProtocol { } var base64Pubkey: String { - String(openSshPubkey.split(separator: " ")[1]) + let split = openSshPubkey.split(separator: " ") + if split.count >= 2 { + return String(split[1]) + } else { + return "Error creating OpenSSH Publickey" + } } var base64Privkey: String { diff --git a/ShhShell/Views/Hosts/RecentsView.swift b/ShhShell/Views/Hosts/RecentsView.swift index 7461392..b5d35c0 100644 --- a/ShhShell/Views/Hosts/RecentsView.swift +++ b/ShhShell/Views/Hosts/RecentsView.swift @@ -98,7 +98,7 @@ struct RecentsView: View { .foregroundStyle(hostsManager.tint) } .buttonStyle(.plain) - .disabled(historyLimit != 0) + .disabled(historyLimit >= hostsManager.history.count) .padding(.trailing, 10) Button {