From 97366a0c4ee384701a34a3ec816111fae43f6fd1 Mon Sep 17 00:00:00 2001 From: Luqman Aden Date: Wed, 5 Sep 2012 22:14:37 -0400 Subject: [PATCH] Bug 786897 - Command line option -private crashes, if privacy mode is enabled in preferences. r=ehsan --- .../privatebrowsing/src/nsPrivateBrowsingService.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/browser/components/privatebrowsing/src/nsPrivateBrowsingService.js b/browser/components/privatebrowsing/src/nsPrivateBrowsingService.js index 1843ebf50f3..ffe4a7c3ac5 100644 --- a/browser/components/privatebrowsing/src/nsPrivateBrowsingService.js +++ b/browser/components/privatebrowsing/src/nsPrivateBrowsingService.js @@ -479,6 +479,10 @@ PrivateBrowsingService.prototype = { this._obs.removeObserver(this, "command-line-startup"); aSubject.QueryInterface(Ci.nsICommandLine); if (aSubject.findFlag("private", false) >= 0) { + // Don't need to go into PB mode if it's already set to autostart + if (this._autoStarted) + aSubject.handleFlag("private", false); + this.privateBrowsingEnabled = true; this._autoStarted = true; this._lastChangedByCommandLine = true;