From 566c5bab8c494f24960c85a5eb7c9871977d7154 Mon Sep 17 00:00:00 2001 From: Edward Lee Date: Wed, 4 Apr 2018 11:42:06 +0900 Subject: [PATCH] try catch for destroy --- src/web-push-lib.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/web-push-lib.js b/src/web-push-lib.js index 8e2911b7..f21ddddf 100644 --- a/src/web-push-lib.js +++ b/src/web-push-lib.js @@ -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) { @@ -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]; } }