Use first login found if there are multiple GUIDs

This commit is contained in:
Anant Narayanan 2009-05-24 00:25:30 +02:00
parent b6a3ce9d6e
commit dbad6932cb

View File

@ -111,10 +111,11 @@ PasswordStore.prototype = {
prop.setPropertyAsAUTF8String("guid", id); prop.setPropertyAsAUTF8String("guid", id);
let logins = Svc.Login.searchLogins({}, prop); let logins = Svc.Login.searchLogins({}, prop);
if (logins.length == 1) { if (logins.length > 0) {
this._log.info(logins.length + " items matching " + id + " found.");
return logins[0]; return logins[0];
} else { } else {
this._log.warn(logins.length + " items matching " + id + ". Ignoring"); this._log.warn("No items matching " + id + " found. Ignoring");
} }
return false; return false;
}, },