Skip to content
This repository has been archived by the owner on Feb 26, 2021. It is now read-only.

Commit

Permalink
Avoid find.find error when no tab is found
Browse files Browse the repository at this point in the history
  • Loading branch information
ianb committed Oct 3, 2019
1 parent cac1f07 commit c02b0d9
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions extension/intents/find/find.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,11 @@ this.intents.find = (function() {
const matches = fuse.search(query);
log.debug("find matches:", matches);
// TODO account for multiple matches
if (!matches.length) {
const e = new Error("No matching tab found");
e.displayMessage = "No matching tab found";
throw e;
}
const topMatch = parseInt(matches[0].item);
await browser.tabs.update(topMatch, {
active: true,
Expand Down

0 comments on commit c02b0d9

Please sign in to comment.