diff --git a/client/karma.js b/client/karma.js index 97b3b62fe..ab11c07f2 100644 --- a/client/karma.js +++ b/client/karma.js @@ -141,9 +141,11 @@ function Karma (socket, iframe, opener, navigator, location) { message += '\n\n' + error.stack } - // create an object with the string representation of the message to ensure all its content is properly - // transferred to the console log - message = {message: message, str: message.toString()} + if (typeof message !== 'string') { + // create an object with the string representation of the message to ensure all its content is properly + // transferred to the console log + message = {message: message, str: message.toString()} + } socket.emit('karma_error', message) this.complete()