diff --git a/lam/lib/lamdaemon.inc b/lam/lib/lamdaemon.inc index 5ef5d780..6685323d 100644 --- a/lam/lib/lamdaemon.inc +++ b/lam/lib/lamdaemon.inc @@ -103,9 +103,9 @@ function lamLoginSSH($handle) { } } $password = $credentials[1]; - if (!empty($_SESSION['config']->getScriptSSHKey())) { + $keyPath = $_SESSION['config']->getScriptSSHKey(); + if (!empty($keyPath)) { // use key authentication - $keyPath = $_SESSION['config']->getScriptSSHKey(); if (!file_exists($keyPath) || !is_readable($keyPath)) { throw new Exception(sprintf(_("Unable to read %s."), htmlspecialchars($keyPath))); }