Skip to content

Commit

Permalink
Null check before setting drawable padding
Browse files Browse the repository at this point in the history
  • Loading branch information
balysv committed Oct 7, 2014
1 parent 7991cc2 commit 2fe051a
Showing 1 changed file with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -188,11 +188,13 @@ public void onRestoreInstanceState(Parcelable state) {
}

private void adjustDrawablePadding() {
drawable.setBounds(
0, 0,
drawable.getIntrinsicWidth() + getPaddingLeft() + getPaddingRight(),
drawable.getIntrinsicHeight() + getPaddingTop() + getPaddingBottom()
);
if (drawable != null) {
drawable.setBounds(
0, 0,
drawable.getIntrinsicWidth() + getPaddingLeft() + getPaddingRight(),
drawable.getIntrinsicHeight() + getPaddingTop() + getPaddingBottom()
);
}
}

private TypedArray getTypedArray(Context context, AttributeSet attributeSet, int[] attr) {
Expand Down

0 comments on commit 2fe051a

Please sign in to comment.