Skip to content

Commit

Permalink
Fix crash when selected color doesn't exist
Browse files Browse the repository at this point in the history
  • Loading branch information
jeromepl committed May 13, 2022
1 parent f5f71a9 commit 7fce1f4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion background.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ async function getCurrentColor() {
const { color } = await chrome.storage.sync.get("color");
const colorTitle = color || DEFAULT_COLOR_TITLE;
const colorOptions = await getColorOptions();
return colorOptions.find((colorOption) => colorOption.title === colorTitle);
return colorOptions.find((colorOption) => colorOption.title === colorTitle) || colorOptions[0];
}

function highlightTextFromContext() {
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 7fce1f4

Please sign in to comment.