[geary/geary-0.11] Don't crash on login failure when server response has no response code.



commit 9d08e6378ebaa0010e5ecaa4120279fcbceefa34
Author: Michael James Gratton <mike vee net>
Date:   Thu Jan 12 01:20:13 2017 +1100

    Don't crash on login failure when server response has no response code.
    
    Bug 777138.
    
    * src/engine/imap-engine/imap-engine-generic-account.vala (Account):
      Check the response's response_code is not null before calling it.

 .../imap-engine/imap-engine-generic-account.vala   |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/src/engine/imap-engine/imap-engine-generic-account.vala 
b/src/engine/imap-engine/imap-engine-generic-account.vala
index de844b8..b79688a 100644
--- a/src/engine/imap-engine/imap-engine-generic-account.vala
+++ b/src/engine/imap-engine/imap-engine-generic-account.vala
@@ -965,7 +965,11 @@ private abstract class Geary.ImapEngine.GenericAccount : Geary.Account {
     private async void do_login_failed_async(Geary.Credentials? credentials, Geary.Imap.StatusResponse? 
response) {
         bool reask_password = true;
         try {
-            reask_password = (response == null || response.response_code.get_response_code_type().value != 
Geary.Imap.ResponseCodeType.UNAVAILABLE);
+            reask_password = (
+                response == null ||
+                response.response_code == null ||
+                response.response_code.get_response_code_type().value != 
Geary.Imap.ResponseCodeType.UNAVAILABLE
+            );
         } catch (ImapError ierr) {
             debug("Unable to parse ResponseCode %s: %s", response.response_code.to_string(),
                 ierr.message);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]