Skip to content

Commit

Permalink
Fix error on the initialization (#543)
Browse files Browse the repository at this point in the history
It is caused by the preference "browser.tabs.autoHide" which is not defined in the default branch.
  • Loading branch information
piroor committed Aug 23, 2013
1 parent a38d21e commit a60af4b
Showing 1 changed file with 20 additions and 15 deletions.
35 changes: 20 additions & 15 deletions modules/lib/prefs.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ if (typeof window == 'undefined' ||
}

(function() {
const currentRevision = 9;
const currentRevision = 10;

if (!('piro.sakura.ne.jp' in window)) window['piro.sakura.ne.jp'] = {};

Expand Down Expand Up @@ -81,20 +81,25 @@ if (typeof window == 'undefined' ||
if (aInterface)
return aBranch.getComplexValue(aPrefstring, aInterface);

switch (type)
{
case aBranch.PREF_STRING:
return decodeURIComponent(escape(aBranch.getCharPref(aPrefstring)));

case aBranch.PREF_INT:
return aBranch.getIntPref(aPrefstring);

case aBranch.PREF_BOOL:
return aBranch.getBoolPref(aPrefstring);

case aBranch.PREF_INVALID:
default:
return null;
try {
switch (type)
{
case aBranch.PREF_STRING:
return decodeURIComponent(escape(aBranch.getCharPref(aPrefstring)));

case aBranch.PREF_INT:
return aBranch.getIntPref(aPrefstring);

case aBranch.PREF_BOOL:
return aBranch.getBoolPref(aPrefstring);

case aBranch.PREF_INVALID:
default:
return null;
}
} catch(e) {
// getXXXPref can raise an error if it is the default branch.
return null;
}
},

Expand Down

0 comments on commit a60af4b

Please sign in to comment.