mirror of
https://github.com/gorhill/uBlock.git
synced 2024-09-15 07:22:28 +02:00
code review
This commit is contained in:
parent
fa88ba77fd
commit
1e464ccb4a
@ -201,8 +201,7 @@ var onDisconnect = function(port) {
|
||||
listener(msg, port.sender, nullFunc);
|
||||
|
||||
// Cleanup port if no longer in use.
|
||||
port = nameToPortMap[port.name];
|
||||
if ( port ) {
|
||||
if ( nameToPortMap.hasOwnProperty(port.name) ) {
|
||||
delete nameToPortMap[port.name];
|
||||
port.onMessage.removeListener(onMessage);
|
||||
port.onDisconnect.removeListener(onDisconnect);
|
||||
|
Loading…
Reference in New Issue
Block a user