Skip to content

Commit

Permalink
[Checkbox] Fixed NPE crash due to layer drawable's constant state iss…
Browse files Browse the repository at this point in the history
…ue in APIs < 23.

PiperOrigin-RevId: 470825166
(cherry picked from commit b8e1b57)
  • Loading branch information
leticiarossi authored and imhappi committed Aug 30, 2022
1 parent ec1663f commit 7e18ac4
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -157,14 +157,14 @@ public static Drawable createTintableDrawableIfNeeded(
* 21, it'll still mutate the drawable.
*
* <p>Use this method instead of the above if the passed in drawable will be a child of a {@link
* LayerDrawable} in APIs < 21, its tintList may be null, and it may be mutated, in order to
* LayerDrawable} in APIs < 23, its tintList may be null, and it may be mutated, in order to
* prevent issue where the drawable may not have its constant state set up properly.
*/
@Nullable
public static Drawable createTintableMutatedDrawableIfNeeded(
@Nullable Drawable drawable, @Nullable ColorStateList tintList, @Nullable Mode tintMode) {
return createTintableMutatedDrawableIfNeeded(
drawable, tintList, tintMode, VERSION.SDK_INT < VERSION_CODES.LOLLIPOP);
drawable, tintList, tintMode, VERSION.SDK_INT < VERSION_CODES.M);
}

@Nullable
Expand Down

0 comments on commit 7e18ac4

Please sign in to comment.