From fd7abd5c32f5cb3a33a0a2bd9221bb28ab545787 Mon Sep 17 00:00:00 2001 From: caneleex Date: Fri, 27 Aug 2021 17:59:32 +0200 Subject: [PATCH] add a check for unknown categories --- app/src/main/java/pl/jakubweg/SponsorBlockUtils.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/src/main/java/pl/jakubweg/SponsorBlockUtils.java b/app/src/main/java/pl/jakubweg/SponsorBlockUtils.java index a05116f4..8ac1e0a6 100644 --- a/app/src/main/java/pl/jakubweg/SponsorBlockUtils.java +++ b/app/src/main/java/pl/jakubweg/SponsorBlockUtils.java @@ -585,6 +585,10 @@ public abstract class SponsorBlockUtils { String categoryKey = categorySelectionObject.getString("name"); SponsorBlockSettings.SegmentInfo category = SponsorBlockSettings.SegmentInfo.byCategoryKey(categoryKey); + if (category == null) { + continue; + } + int desktopKey = categorySelectionObject.getInt("option"); SponsorBlockSettings.SegmentBehaviour behaviour = SponsorBlockSettings.SegmentBehaviour.byDesktopKey(desktopKey); editor.putString(category.key, behaviour.key);