Skip to content

Commit b5533ea

Browse files
ymariandsn5ft
authored andcommitted
Swallow exception setting convex path in MaterialShapeDrawable for pre releases of Q
PiperOrigin-RevId: 306874530
1 parent 4fb2375 commit b5533ea

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

lib/java/com/google/android/material/shape/MaterialShapeDrawable.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1180,7 +1180,13 @@ public void getOutline(@NonNull Outline outline) {
11801180

11811181
calculatePath(getBoundsAsRectF(), path);
11821182
if (path.isConvex() || Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
1183-
outline.setConvexPath(path);
1183+
try {
1184+
outline.setConvexPath(path);
1185+
} catch (IllegalArgumentException ignored) {
1186+
// The change to support concave paths was done late in the release cycle. People
1187+
// using pre-releases of Q would experience a crash here.
1188+
}
1189+
11841190
}
11851191
}
11861192

0 commit comments

Comments
 (0)