From f46584a8a9888b9e472ba1447bcb979cc5610852 Mon Sep 17 00:00:00 2001 From: "Brian R. Bondy" Date: Mon, 12 Dec 2016 00:59:03 -0500 Subject: [PATCH] Fix renderer IPC failing This is failing a bunch of automated tests and general functionality. Bug was introduced here: https://github.com/brave/electron/commit/96b2f088ae2fc35e9fa3a7232092182e4ea50fa5#diff-6d7213223d17eee94ce8a64e16ead954L29 The assignment was shortcircuited with `arguments[1] &&` before. Fix https://github.com/brave/browser-laptop/issues/6151 Auditors: @bridiver --- atom/common/api/resources/ipc_utils.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/atom/common/api/resources/ipc_utils.js b/atom/common/api/resources/ipc_utils.js index 4ce073f478..fdfcfd907c 100644 --- a/atom/common/api/resources/ipc_utils.js +++ b/atom/common/api/resources/ipc_utils.js @@ -25,7 +25,9 @@ if (!ipcRenderer) { } ipcRenderer.emit = function () { - arguments[1].sender = ipcRenderer + if (arguments[1]) { + arguments[1].sender = ipcRenderer + } return $Function.apply(EventEmitter.prototype.emit, ipcRenderer, arguments) } atom.v8.setHiddenValue('ipc', ipcRenderer)