From 811c51427426daff3669e1b6e11441999126e498 Mon Sep 17 00:00:00 2001 From: johnjbarton Date: Fri, 12 Apr 2019 09:36:28 -0700 Subject: [PATCH] fix(client): Only create the funky object if message is not a string Fixes #3296 --- client/karma.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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()