Created
November 7, 2011 20:01
-
-
Save MostAwesomeDude/1345989 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
commit be6c1758ea376f9559aa117bf1ec44340b4eff2c | |
Author: Corbin Simpson <[email protected]> | |
Date: Fri Oct 21 13:48:16 2011 -0700 | |
static: Don't try to dereference possibly undefined module when initializing. | |
Fixes failed init when Logging isn't enabled. | |
diff --git a/gateone/static/gateone.js b/gateone/static/gateone.js | |
index cf8907e..56d6473 100644 | |
--- a/gateone/static/gateone.js | |
+++ b/gateone/static/gateone.js | |
@@ -195,11 +195,19 @@ GateOne.Base.update(GateOne, { | |
GateOne.Utils.loadPrefs(); | |
} | |
// Assign our logging function shortcuts if the Logging module is available with a safe fallback | |
- logFatal = GateOne.Logging.logFatal || GateOne.Utils.noop; | |
- logError = GateOne.Logging.logError || GateOne.Utils.noop; | |
- logWarning = GateOne.Logging.logWarning || GateOne.Utils.noop; | |
- logInfo = GateOne.Logging.logInfo || GateOne.Utils.noop; | |
- logDebug = GateOne.Logging.logDebug || GateOne.Utils.noop; | |
+ if (GateOne.Logging) { | |
+ logFatal = GateOne.Logging.logFatal; | |
+ logError = GateOne.Logging.logError; | |
+ logWarning = GateOne.Logging.logWarning; | |
+ logInfo = GateOne.Logging.logInfo; | |
+ logDebug = GateOne.Logging.logDebug; | |
+ } else { | |
+ logFatal = GateOne.Utils.noop; | |
+ logError = GateOne.Utils.noop; | |
+ logWarning = GateOne.Utils.noop; | |
+ logInfo = GateOne.Utils.noop; | |
+ logDebug = GateOne.Utils.noop; | |
+ } | |
var go = GateOne, | |
u = go.Utils, | |
pb = GateOne.Playback, | |
@@ -2735,4 +2743,4 @@ GateOne.Net.actions = { | |
window.GateOne = GateOne; // Make everything usable | |
-})(window); | |
\ No newline at end of file | |
+})(window); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment