Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

Commit

Permalink
fix crash when closing a window containing a magnet tab
Browse files Browse the repository at this point in the history
  • Loading branch information
dcposch committed Nov 15, 2016
1 parent 37f957a commit 349d13b
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion app/browser/webtorrent.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,14 @@ function init () {
function send (msg) {
if (DEBUG_IPC) console.log('Sending IPC: ' + JSON.stringify(msg))
const channel = channels[msg.clientKey]
if (!channel) throw new Error('Unrecognized clientKey ' + msg.clientKey)
if (!channel) {
if (DEBUG_IPC) console.error('Ignoring unrecognized clientKey ' + msg.clientKey)
return
}
if (channel.isDestroyed()) {
if (DEBUG_IPC) console.log('Removing destroyed channel, clientKey ' + msg.clientKey)
delete channels[msg.clientKey]
return
}
channel.send(messages.TORRENT_MESSAGE, msg)
}

0 comments on commit 349d13b

Please sign in to comment.