Fix critical when IMAP login command is cancelled

The command's status will be null if the op was cancelled.
This commit is contained in:
Michael Gratton 2019-01-09 12:27:52 +11:00 committed by Michael James Gratton
parent db85a3449d
commit 33ae35f613

View file

@ -881,14 +881,16 @@ public class Geary.Imap.ClientSession : BaseObject {
}
if (login_err != null) {
// Throw an error indicating auth failed here, unless the
// response code indicated that the server is merely
// unavailable, then don't since the creds might actually
// be fine.
ResponseCode? code = cmd.status.response_code;
// Throw an error indicating auth failed here, unless
// there is a status response and it indicates that the
// server is merely reporting login as being unavailable,
// then don't since the creds might actually be fine.
ResponseCodeType? code_type = null;
if (code != null) {
code_type = code.get_response_code_type();
if (cmd.status != null) {
ResponseCode? code = cmd.status.response_code;
if (code != null) {
code_type = code.get_response_code_type();
}
}
if (code_type == null ||