mirror of
https://github.com/gorhill/uBlock.git
synced 2026-03-11 09:04:36 +00:00
code review
This commit is contained in:
parent
fa88ba77fd
commit
1e464ccb4a
1 changed files with 1 additions and 2 deletions
|
|
@ -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 a new issue