Permalink
Browse files

Don't die if we found Scratchpad but the 'enabled' pref doesn't exist.

  • Loading branch information...
1 parent 2fc483f commit 8061d971c594379d862c49522c8e56834de3ae46 @supahgreg supahgreg committed Sep 3, 2011
Showing with 6 additions and 2 deletions.
  1. +6 −2 extension/modules/utils/Scriptish_getEditor.js
View
8 extension/modules/utils/Scriptish_getEditor.js
@@ -38,8 +38,12 @@ const Scriptish_getEditor = function(parentWindow, change) {
// pick a non-executable file, so we set this up in a loop so that if they do
// that we can give them an error and try again.
var hasScratchpad =
- !!Services.wm.getMostRecentWindow("navigator:browser").Scratchpad
- && Services.prefs.getBoolPref("devtools.scratchpad.enabled");
+ !!Services.wm.getMostRecentWindow("navigator:browser").Scratchpad;
+ try {
+ hasScratchpad = hasScratchpad
+ && Services.prefs.getBoolPref("devtools.scratchpad.enabled");
+ } catch(e) {}
+
var sp = Services.prompt;
var flags = sp.BUTTON_POS_0 * sp.BUTTON_TITLE_IS_STRING
+ sp.BUTTON_POS_1 * sp.BUTTON_TITLE_IS_STRING;

0 comments on commit 8061d97

Please sign in to comment.