Skip to content

Commit

Permalink
ssh: fix crash if there are two ssh doors
Browse files Browse the repository at this point in the history
  • Loading branch information
mwarning committed Mar 21, 2022
1 parent 091d8ec commit c50a169
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions app/src/main/java/app/trigger/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -465,15 +465,13 @@ private boolean checkSshPassphrase(Setup setup, Action action) {
// try other passphrases
for (Setup s : Settings.getSetups()) {
if (s instanceof SshDoorSetup) {
continue;
}

SshDoorSetup ss = (SshDoorSetup) s;
if (ss.needsPassphrase() && !Utils.isEmpty(ss.passphrase_tmp)) {
if (SshRequestHandler.testPassphrase(door.keypair, ss.passphrase_tmp)) {
showMessage("Reuse passphrase from " + door.getName());
door.passphrase_tmp = ss.passphrase_tmp;
return true;
SshDoorSetup ss = (SshDoorSetup) s;
if (ss.needsPassphrase() && !Utils.isEmpty(ss.passphrase_tmp)) {
if (SshRequestHandler.testPassphrase(door.keypair, ss.passphrase_tmp)) {
showMessage("Reuse passphrase from " + door.getName());
door.passphrase_tmp = ss.passphrase_tmp;
return true;
}
}
}
}
Expand Down

0 comments on commit c50a169

Please sign in to comment.