diff --git a/lib/ssh/rsa_key_pair.dart b/lib/ssh/rsa_key_pair.dart index f7ce45ef..12473bc6 100644 --- a/lib/ssh/rsa_key_pair.dart +++ b/lib/ssh/rsa_key_pair.dart @@ -72,6 +72,9 @@ class RsaKeyPair { // Tries to encrypt and decrypt bool isValid() { + if (publicKey == null || privateKey == null) { + return false; + } var orig = 'word'; var enc = publicKey.encrypt(orig); var dec = privateKey.decrypt(enc);