Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d6eac46

Browse files
authored
Merge pull request mikepenz#364 from Robyer/fix/closingPathException
Fix exception when closing empty path
2 parents f745b50 + 2ef8584 commit d6eac46

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

library-core/src/main/java/com/mikepenz/iconics/IconicsDrawable.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1090,7 +1090,9 @@ public void draw(@NonNull Canvas canvas) {
10901090
}
10911091
}
10921092

1093-
mPath.close();
1093+
if (!mPath.isEmpty()) {
1094+
mPath.close();
1095+
}
10941096

10951097
if (mDrawContour) {
10961098
canvas.drawPath(mPath, mContourPaint);
@@ -1127,7 +1129,9 @@ public void setTintMode(@NonNull PorterDuff.Mode tintMode) {
11271129
@Override
11281130
protected void onBoundsChange(Rect bounds) {
11291131
offsetIcon(bounds);
1130-
mPath.close();
1132+
if (!mPath.isEmpty()) {
1133+
mPath.close();
1134+
}
11311135
super.onBoundsChange(bounds);
11321136
}
11331137

0 commit comments

Comments
 (0)