Skip to content

Commit 8489bc2

Browse files
committed
Fix error when using hotkey without an active tab
1 parent fc7a4ca commit 8489bc2

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

source/background.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,11 @@ chrome.commands.onCommand.addListener(function(command)
8080
// Fetch the active tab
8181
chrome.tabs.query({ active: true, windowId: chrome.windows.WINDOW_ID_CURRENT }, function(tabs)
8282
{
83+
// Do nothing when there is no active tab atm
84+
if (tabs.length == 0) {
85+
return;
86+
}
87+
8388
// Get the current state
8489
chrome.tabs.sendMessage(
8590
tabs[0].id,

0 commit comments

Comments
 (0)