From c15a2f5747280c03eabb9bf878733a99df8b6a0d Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Fri, 12 Jan 2018 16:34:51 -0500 Subject: [PATCH] only send message when there is a page on tab --- src/browser/browserApi.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/browser/browserApi.ts b/src/browser/browserApi.ts index b02e669825..26d3226c6d 100644 --- a/src/browser/browserApi.ts +++ b/src/browser/browserApi.ts @@ -97,11 +97,10 @@ class BrowserApi { } const t = win.tabs[tab.index]; - if (!t.page) { - return Promise.reject('No page on this tab.'); + if (t.page) { + t.page.dispatchMessage('bitwarden', obj); } - t.page.dispatchMessage('bitwarden', obj); return Promise.resolve(); } }