Bug 1398136 - use startup profile dir if necessary, r?MattN
MozReview-Commit-ID: GZPsnG3UE8G
--- a/toolkit/components/xulstore/XULStore.js
+++ b/toolkit/components/xulstore/XULStore.js
@@ -56,17 +56,25 @@ XULStore.prototype = {
_storeFile: null,
_needsSaving: false,
_saveAllowed: true,
_writeTimer: Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer),
load() {
Services.obs.addObserver(this, "profile-before-change", true);
- this._storeFile = Services.dirsvc.get("ProfD", Ci.nsIFile);
+ try {
+ this._storeFile = Services.dirsvc.get("ProfD", Ci.nsIFile);
+ } catch (ex) {
+ try {
+ this._storeFile = Services.dirsvc.get("ProfDS", Ci.nsIFile);
+ } catch (ex) {
+ throw new Error("Can't find profile directory.");
+ }
+ }
this._storeFile.append(STOREDB_FILENAME);
this.readFile();
},
observe(subject, topic, data) {
this.writeFile();
if (topic == "profile-before-change") {