From 2b01c37b49e04ea162ccf8cb08f4c2d72e51a229 Mon Sep 17 00:00:00 2001 From: Samantha Chalker Date: Mon, 15 May 2017 15:01:53 -0400 Subject: [PATCH] Version 1.0.9: Fix debug failover not returning as function, making production builds error. Update lib/electron to console.error if debug.electron is not a function. --- lib/debug.js | 2 +- lib/electron.js | 4 ++-- package.json | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/debug.js b/lib/debug.js index 198de6b..f8fa866 100644 --- a/lib/debug.js +++ b/lib/debug.js @@ -1,5 +1,5 @@ try { module.exports = require('debug'); } catch(e) { - module.exports = function() { } + module.exports = function(){ return function(){} } } diff --git a/lib/electron.js b/lib/electron.js index a7d094a..09719fd 100644 --- a/lib/electron.js +++ b/lib/electron.js @@ -203,11 +203,11 @@ ipcMain.on('app-bounce-cancel', (e, id) => app.dock.cancelBounce(Number(id))); process.on('uncaughtException', reason => { if(reason.code === 'EADDRINUSE' && mainWindow !== null) return; - debug.electron(`Uncaught ${reason.stack}`); + (typeof debug.electron !== 'function' ? console.error : debug.electron)(`Uncaught ${reason.stack}`); process.exit(1); }); process.on('unhandledRejection', (reason, p) => { - debug.electron(`Uncaught [Promise] ${reason.stack}`); + (typeof debug.electron !== 'function' ? console.error : debug.electron)(`Uncaught [Promise] ${reason.stack}`); process.exit(1); }); diff --git a/package.json b/package.json index adaddca..5331a87 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "wssip", - "version": "1.0.8", + "version": "1.0.9", "description": "Intercepting Proxy Application to capture, modify and send custom data from one WebSocket host to another, primarily for penetration testing. Supports WebSocket RFC6455 implementations and Socket.io.", "main": "lib/electron.js", "bin": {