From 6a53e6d0ac53db7d484890b7a2160338bbab164e Mon Sep 17 00:00:00 2001 From: gorhill Date: Tue, 4 Jul 2017 09:33:03 -0400 Subject: [PATCH] minor code review --- platform/chromium/vapi-background.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/chromium/vapi-background.js b/platform/chromium/vapi-background.js index 7ee4c5f7a..34e8d1c12 100644 --- a/platform/chromium/vapi-background.js +++ b/platform/chromium/vapi-background.js @@ -479,7 +479,7 @@ vAPI.tabs.open = function(details) { chrome.tabs.query({ url: targetURLWithoutHash }, function(tabs) { if ( chrome.runtime.lastError ) { /* noop */ } - var tab = tabs[0]; + var tab = Array.isArray(tabs) && tabs[0]; if ( !tab ) { wrapper(); return;