Bug 1508046 - return cleanly in LDAP autocomplete search if we are offline. r=mkmelin
authoraceman <acelists@atlas.sk>
Sat, 17 Nov 2018 05:41:00 +0100
changeset 33727 8cf3f95e48e8b97a754cd22446ef6231e65791d3
parent 33726 062d7a8d50be38a9b05c584051ace406f2cf1fca
child 33728 ffda4a36eba4288f242646b7ebc89a0dcf96019e
push id388
push userclokep@gmail.com
push dateMon, 28 Jan 2019 20:54:56 +0000
reviewersmkmelin
bugs1508046
Bug 1508046 - return cleanly in LDAP autocomplete search if we are offline. r=mkmelin
mailnews/addrbook/src/nsAbLDAPAutoCompleteSearch.js
--- a/mailnews/addrbook/src/nsAbLDAPAutoCompleteSearch.js
+++ b/mailnews/addrbook/src/nsAbLDAPAutoCompleteSearch.js
@@ -203,18 +203,18 @@ nsAbLDAPAutoCompleteSearch.prototype = {
     if (identity && identity.overrideGlobalPref)
       acDirURI = identity.directoryServer;
     else {
       // Try the global one
       if (Services.prefs.getBoolPref("ldap_2.autoComplete.useDirectory"))
         acDirURI = Services.prefs.getCharPref("ldap_2.autoComplete.directoryServer");
     }
 
-    if (!acDirURI) {
-      // No directory to search, send a no match and return.
+    if (!acDirURI || Services.io.offline) {
+      // No directory to search or we are offline, send a no match and return.
       aListener.onSearchResult(this, this._result);
       return;
     }
 
     this.stopSearch();
 
     // If we don't already have a cached query for this URI, build a new one.
     acDirURI = "moz-abldapdirectory://" + acDirURI;