diff --git a/public/js/debug-console.js b/public/js/debug-console.js index 8b01de4..18ef319 100644 --- a/public/js/debug-console.js +++ b/public/js/debug-console.js @@ -8,7 +8,12 @@ window.console[func] = function(msg) { var style = null; var messages = Array.prototype.slice.call(arguments); - if (arguments[0].indexOf('%c') > -1 && arguments.length > 1) { + + // e.g. console.log('%cHello', 'background: red', 'foobar'); + if (arguments.length > 1 && + typeof arguments[0] === 'string' && + typeof arguments[1] === 'string' && + arguments[0].indexOf('%c') > -1) { style = arguments[1]; messages.splice(1, 1); // remove style string from console output }