Bug 1508046 - return cleanly in LDAP autocomplete search if we are offline. r=mkmelin a=jorgk
authoraceman <acelists@atlas.sk>
Sat, 17 Nov 2018 05:41:00 +0100
changeset 33489 e0e70ed02daaa486cc65bd4b3d571ba900d3adf4
parent 33488 5ca1b2b18ca0fad0ca0e64665b88d651b5fa5c24
child 33490 7b73575205fc877a14e236a77720fbfbf8e9fa82
push id387
push userclokep@gmail.com
push dateMon, 10 Dec 2018 21:30:47 +0000
reviewersmkmelin, jorgk
bugs1508046
Bug 1508046 - return cleanly in LDAP autocomplete search if we are offline. r=mkmelin a=jorgk
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;