From e2f52905dc445f881666c06877c3a69306335dcb Mon Sep 17 00:00:00 2001 From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com> Date: Fri, 5 May 2023 10:32:10 +0400 Subject: [PATCH] fix(youtube/theme): fix app crash if user clears seekbar color (#390) --- .../app/revanced/integrations/patches/theme/ThemePatch.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/app/revanced/integrations/patches/theme/ThemePatch.java b/app/src/main/java/app/revanced/integrations/patches/theme/ThemePatch.java index c21c3670..6a13c6e6 100644 --- a/app/src/main/java/app/revanced/integrations/patches/theme/ThemePatch.java +++ b/app/src/main/java/app/revanced/integrations/patches/theme/ThemePatch.java @@ -13,6 +13,9 @@ public final class ThemePatch { SettingsEnum.SEEKBAR_COLOR.saveValue(SettingsEnum.SEEKBAR_COLOR.defaultValue); } + /** + * Injection point. + */ public static int getSeekbarClickedColorValue(final int colorValue) { // YouTube uses a specific color when the seekbar is clicked. Override in that case. return colorValue == ORIGINAL_SEEKBAR_CLICKED_COLOR ? getSeekbarColorValue() : colorValue; @@ -21,7 +24,7 @@ public final class ThemePatch { public static int getSeekbarColorValue() { try { return Color.parseColor(SettingsEnum.SEEKBAR_COLOR.getString()); - } catch (IllegalArgumentException exception) { + } catch (Exception exception) { resetSeekbarColor(); return getSeekbarColorValue(); }