Skip to content

Commit 7e18ac4

Browse files
leticiarossiimhappi
authored andcommitted
[Checkbox] Fixed NPE crash due to layer drawable's constant state issue in APIs < 23.
PiperOrigin-RevId: 470825166 (cherry picked from commit b8e1b57)
1 parent ec1663f commit 7e18ac4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/java/com/google/android/material/drawable/DrawableUtils.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,14 +157,14 @@ public static Drawable createTintableDrawableIfNeeded(
157157
* 21, it'll still mutate the drawable.
158158
*
159159
* <p>Use this method instead of the above if the passed in drawable will be a child of a {@link
160-
* LayerDrawable} in APIs < 21, its tintList may be null, and it may be mutated, in order to
160+
* LayerDrawable} in APIs < 23, its tintList may be null, and it may be mutated, in order to
161161
* prevent issue where the drawable may not have its constant state set up properly.
162162
*/
163163
@Nullable
164164
public static Drawable createTintableMutatedDrawableIfNeeded(
165165
@Nullable Drawable drawable, @Nullable ColorStateList tintList, @Nullable Mode tintMode) {
166166
return createTintableMutatedDrawableIfNeeded(
167-
drawable, tintList, tintMode, VERSION.SDK_INT < VERSION_CODES.LOLLIPOP);
167+
drawable, tintList, tintMode, VERSION.SDK_INT < VERSION_CODES.M);
168168
}
169169

170170
@Nullable

0 commit comments

Comments
 (0)