Skip to content

Commit

Permalink
try catch for destroy
Browse files Browse the repository at this point in the history
  • Loading branch information
Edward Lee committed Apr 4, 2018
1 parent 9ac57ea commit 566c5ba
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/web-push-lib.js
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,10 @@ WebPushLib.prototype.sendNotification =
try {
pushRequest.rstWithCancel();
if(clientSessions[host]) {
clientSessions[host].destroy();
try {
clientSessions[host].destroy();
} catch(e) {
}
delete clientSessions[host];
}
} catch(e) {
Expand Down Expand Up @@ -339,7 +342,10 @@ WebPushLib.prototype.sendNotification =
WebPushLib.prototype.closeHttp2Connection =
function() {
for(let i in clientSessions) {
clientSessions[i].destroy();
try {
clientSessions[i].destroy();
} catch(e) {
}
delete clientSessions[i];
}
}
Expand Down

0 comments on commit 566c5ba

Please sign in to comment.