add a check for unknown categories

This commit is contained in:
caneleex 2021-08-27 17:59:32 +02:00
parent f605ba61af
commit cf6101dca9
1 changed files with 4 additions and 0 deletions

View File

@ -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);