From 9478bfe6a4b17886401ae609ced5e5a95969194c Mon Sep 17 00:00:00 2001 From: Ajay Ramachandran Date: Mon, 31 May 2021 14:45:39 -0400 Subject: Don't crash if bar types are missing --- src/components/CategorySkipOptionsComponent.tsx | 4 ++-- src/js-components/previewBar.ts | 2 +- src/popup.ts | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/CategorySkipOptionsComponent.tsx b/src/components/CategorySkipOptionsComponent.tsx index 3cc03527..a59e3f54 100644 --- a/src/components/CategorySkipOptionsComponent.tsx +++ b/src/components/CategorySkipOptionsComponent.tsx @@ -21,8 +21,8 @@ class CategorySkipOptionsComponent extends React.Component { const categoryColorCircle = document.createElement("span"); categoryColorCircle.id = "sponsorTimesCategoryColorCircle" + UUID; - categoryColorCircle.style.backgroundColor = Config.config.barTypes[segmentTimes[i].category].color; + categoryColorCircle.style.backgroundColor = Config.config.barTypes[segmentTimes[i].category]?.color; categoryColorCircle.classList.add("dot"); categoryColorCircle.classList.add("sponsorTimesCategoryColorCircle"); -- cgit v1.2.3