From 960d74516802c9ba19c990fa674b19d3bec1cce9 Mon Sep 17 00:00:00 2001 From: Vaibhav Tulsyan Date: Sat, 4 Jul 2020 16:17:51 +0530 Subject: [PATCH] Fix runtime error - no groups to tab if no titles match --- src/js/core.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/js/core.js b/src/js/core.js index 10c1079..34a1461 100644 --- a/src/js/core.js +++ b/src/js/core.js @@ -136,7 +136,9 @@ export function groupTabsWithTitle(windowId, title) { console.log(tab.title, tab.url); } console.log("matchingIdxs", matchingIdxs); - chrome.tabs.highlight({'tabs': matchingIdxs}); + if (matchingIds.length != 0) { + chrome.tabs.highlight({'tabs': matchingIdxs}); + } }); }); }