Don't pass undefined sockets to ipc.server.emit()

Changelog-entry: Don't pass undefined sockets to ipc.server.emit()
Change-type: patch
This commit is contained in:
Alexis Svinartchouk 2019-02-27 19:24:17 +01:00
parent 5299d958f2
commit dd583a176f

View File

@ -392,7 +392,10 @@ exports.cancel = () => {
try {
const [ socket ] = ipc.server.sockets
ipc.server.emit(socket, 'cancel')
// eslint-disable-next-line no-undefined
if (socket !== undefined) {
ipc.server.emit(socket, 'cancel')
}
} catch (error) {
analytics.logException(error)
}