Bug 619659 nsPlacesAutoComplete.js depends on nsIPrivateBrowsingService being implemented (Perma Orange for Non-FF apps) - cope with the private browsing service not being there. r=mak a=Unit test bustage fix for non-Firefox apps.
authorMark Banner <bugzilla@standard8.plus.com>
Thu, 16 Dec 2010 14:38:58 +0000
changeset 59400 d386e59d2c7283bcd889a8fafc4f659ae2306b0e
parent 59399 3857de12f888cae028d1cd6d5cf89f6cf063b77e
child 59401 25fc0d97436f8c65409f00d219e418545e838c47
push id1
push usershaver@mozilla.com
push dateTue, 04 Jan 2011 17:58:04 +0000
reviewersmak, Unit
bugs619659
milestone2.0b9pre
Bug 619659 nsPlacesAutoComplete.js depends on nsIPrivateBrowsingService being implemented (Perma Orange for Non-FF apps) - cope with the private browsing service not being there. r=mak a=Unit test bustage fix for non-Firefox apps.
toolkit/components/places/src/nsPlacesAutoComplete.js
--- a/toolkit/components/places/src/nsPlacesAutoComplete.js
+++ b/toolkit/components/places/src/nsPlacesAutoComplete.js
@@ -153,17 +153,22 @@ function initTempTable(aDatabase)
   stmt.finalize();
 }
 
 /**
  * @return true if private browsing is active, false otherwise.
  */
 function inPrivateBrowsingMode()
 {
-  return pb.privateBrowsingEnabled;
+  try {
+    return pb.privateBrowsingEnabled;
+  }
+  catch (ex) {
+    return false;
+  }
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 //// AutoCompleteStatementCallbackWrapper class
 
 /**
  * Wraps a callback and ensures that handleCompletion is not dispatched if the
  * query is no longer tracked.