Permalink
Browse files

fixed ff-console null errors w/ if(!null) wrappers

  • Loading branch information...
pdkl95 committed Jan 8, 2014
1 parent 2a23e96 commit f35ef66e9ac2f7b658c188733d8821421ebb84d6
Showing with 15 additions and 9 deletions.
  1. +15 −9 source/firefox/javascript/overlay/overlay.js
@@ -537,14 +537,18 @@ WebDeveloper.Overlay.setupViewSourceWithKeyboardShortcuts = function(keySet)
// Handles a tab being selected
WebDeveloper.Overlay.tabSelect = function()
{
- // If a feature that uses the element information toolbar is active
- if(WebDeveloper.Dashboard.isOpenInDashboard(WebDeveloper.Locales.getString("elementInformation")) || WebDeveloper.Dashboard.isOpenInDashboard(WebDeveloper.Locales.getString("styleInformation")))
- {
- document.getElementById("web-developer-element-information-toolbar").hidden = false;
- }
- else
- {
- document.getElementById("web-developer-element-information-toolbar").hidden = true;
+ var el = document.getElementById("web-developer-element-information-toolbar");
+
+ if (el) {
+ // If a feature that uses the element information toolbar is active
+ if(WebDeveloper.Dashboard.isOpenInDashboard(WebDeveloper.Locales.getString("elementInformation")) || WebDeveloper.Dashboard.isOpenInDashboard(WebDeveloper.Locales.getString("styleInformation")))
+ {
+ el.hidden = false;
+ }
+ else
+ {
+ el.hidden = true;
+ }
}
WebDeveloper.Overlay.resetCSSStatus();
@@ -826,7 +830,9 @@ WebDeveloper.Overlay.updateJavaScriptStatus = function(error)
// Updates meta redirects
WebDeveloper.Overlay.updateMetaRedirects = function(browserElement)
{
- browserElement.docShell.allowMetaRedirects = !WebDeveloper.Preferences.getExtensionBooleanPreference("meta.redirects.disable");
+ if (browserElement) {
+ browserElement.docShell.allowMetaRedirects = !WebDeveloper.Preferences.getExtensionBooleanPreference("meta.redirects.disable");
+ }
};
// Updates the render mode status button

0 comments on commit f35ef66

Please sign in to comment.