From 64a27e5fd9ecf3ea5dd10dd61a138bf762bcf016 Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Fri, 12 Jan 2018 16:33:36 -0500 Subject: [PATCH] check for no page on tab --- src/browser/browserApi.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/browser/browserApi.ts b/src/browser/browserApi.ts index ea9407ee47..b02e669825 100644 --- a/src/browser/browserApi.ts +++ b/src/browser/browserApi.ts @@ -97,6 +97,10 @@ class BrowserApi { } const t = win.tabs[tab.index]; + if (!t.page) { + return Promise.reject('No page on this tab.'); + } + t.page.dispatchMessage('bitwarden', obj); return Promise.resolve(); }