Skip to content

Commit

Permalink
fix(youtube/theme): fix app crash if user clears seekbar color (#390)
Browse files Browse the repository at this point in the history
  • Loading branch information
LisoUseInAIKyrios committed May 5, 2023
1 parent 2882ec1 commit e2f5290
Showing 1 changed file with 4 additions and 1 deletion.
Expand Up @@ -13,6 +13,9 @@ private static void resetSeekbarColor() {
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;
Expand All @@ -21,7 +24,7 @@ public static int getSeekbarClickedColorValue(final int colorValue) {
public static int getSeekbarColorValue() {
try {
return Color.parseColor(SettingsEnum.SEEKBAR_COLOR.getString());
} catch (IllegalArgumentException exception) {
} catch (Exception exception) {
resetSeekbarColor();
return getSeekbarColorValue();
}
Expand Down

0 comments on commit e2f5290

Please sign in to comment.