summaryrefslogtreecommitdiffstats
path: root/toolkit/components
diff options
context:
space:
mode:
authorjanekptacijarabaci <janekptacijarabaci@seznam.cz>2018-04-20 08:56:09 +0200
committerjanekptacijarabaci <janekptacijarabaci@seznam.cz>2018-04-20 08:56:09 +0200
commit56138c585a6ea609fc5e61c64e93befa0a097c6a (patch)
tree182c4c9b1e829b24e8e1a5134ce91e342e50460a /toolkit/components
parente3d08de2d29be507fcd5c73c328572167fe43af7 (diff)
downloadUXP-56138c585a6ea609fc5e61c64e93befa0a097c6a.tar
UXP-56138c585a6ea609fc5e61c64e93befa0a097c6a.tar.gz
UXP-56138c585a6ea609fc5e61c64e93befa0a097c6a.tar.lz
UXP-56138c585a6ea609fc5e61c64e93befa0a097c6a.tar.xz
UXP-56138c585a6ea609fc5e61c64e93befa0a097c6a.zip
moebius#144: Launch command: basilisk "-migration -p" (throws an error)
https://github.com/MoonchildProductions/moebius/pull/144
Diffstat (limited to 'toolkit/components')
-rw-r--r--toolkit/components/xulstore/XULStore.js18
1 files changed, 14 insertions, 4 deletions
diff --git a/toolkit/components/xulstore/XULStore.js b/toolkit/components/xulstore/XULStore.js
index c2721327c..8b5bc1313 100644
--- a/toolkit/components/xulstore/XULStore.js
+++ b/toolkit/components/xulstore/XULStore.js
@@ -63,11 +63,21 @@ XULStore.prototype = {
load: function () {
Services.obs.addObserver(this, "profile-before-change", true);
- this._storeFile = Services.dirsvc.get("ProfD", Ci.nsIFile);
+ let profileType = "ProfD";
+ try {
+ this._storeFile = Services.dirsvc.get(profileType, Ci.nsIFile);
+ } catch (ex) {
+ try {
+ profileType = "ProfDS";
+ this._storeFile = Services.dirsvc.get(profileType, Ci.nsIFile);
+ } catch (ex) {
+ throw new Error("Can't find profile directory.");
+ }
+ }
this._storeFile.append(STOREDB_FILENAME);
if (!this._storeFile.exists()) {
- this.import();
+ this.import(profileType);
} else {
this.readFile();
}
@@ -90,8 +100,8 @@ XULStore.prototype = {
Services.console.logStringMessage("XULStore: " + message);
},
- import: function() {
- let localStoreFile = Services.dirsvc.get("ProfD", Ci.nsIFile);
+ import(profileType) {
+ let localStoreFile = Services.dirsvc.get(profileType || "ProfD", Ci.nsIFile);
localStoreFile.append("localstore.rdf");
if (!localStoreFile.exists()) {