Closes #6935 Don't crash when user cancels password dialog

This commit is contained in:
Eric Gregory 2013-09-26 15:14:41 -07:00
parent d79b3ef3b0
commit 61335f1159

View file

@ -647,6 +647,11 @@ public class Geary.Imap.ClientSession : BaseObject {
*/
public async StatusResponse login_async(Geary.Credentials credentials, Cancellable? cancellable = null)
throws Error {
if (!credentials.is_complete()) {
login_failed();
throw new ImapError.UNAUTHENTICATED("No credentials provided for account: %s", credentials.to_string());
}
LoginCommand cmd = new LoginCommand(credentials.user, credentials.pass);
MachineParams params = new MachineParams(cmd);