diff options
| author | d34d <clark@cyngn.com> | 2016-03-17 09:38:12 -0700 |
|---|---|---|
| committer | d34d <clark@cyngn.com> | 2016-03-17 14:17:20 -0700 |
| commit | 9ac291bad6edb745d68aab9baf0465c3323d8e4e (patch) | |
| tree | 5f3c661a3fd29fcd3d9f24beb75ffd572e0f42ca | |
| parent | 98e06d73262bc654d546ef2ded2cd6c4db5b92bf (diff) | |
| download | android_frameworks_support-9ac291bad6edb745d68aab9baf0465c3323d8e4e.tar.gz android_frameworks_support-9ac291bad6edb745d68aab9baf0465c3323d8e4e.tar.bz2 android_frameworks_support-9ac291bad6edb745d68aab9baf0465c3323d8e4e.zip | |
v4: Assign mDrawable before calling setBoundsstable/cm-13.0-ZNH2KBstable/cm-13.0-ZNH2K
In setWrappedDrawable, mDrawable is set to null which can cause an
NPE when onBoundsChange is called. This happens when setBounds
is called before mDrawable has been reassigned to the new drawable
to wrap.
Change-Id: I0cdd7c68c6f1156b5429cb9731ce1e25928be9d9
TICKET: CYNGNOS-2250
| -rw-r--r-- | v4/donut/android/support/v4/graphics/drawable/DrawableWrapperDonut.java | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/v4/donut/android/support/v4/graphics/drawable/DrawableWrapperDonut.java b/v4/donut/android/support/v4/graphics/drawable/DrawableWrapperDonut.java index 300e2e8ce1..67a76c442c 100644 --- a/v4/donut/android/support/v4/graphics/drawable/DrawableWrapperDonut.java +++ b/v4/donut/android/support/v4/graphics/drawable/DrawableWrapperDonut.java @@ -245,20 +245,15 @@ class DrawableWrapperDonut extends Drawable implements Drawable.Callback, Drawab if (mDrawable != null) { mDrawable.setCallback(null); } - mDrawable = null; + mDrawable = drawable; if (drawable != null) { // Copy over the bounds from the drawable setBounds(drawable.getBounds()); // Set ourselves as the callback for invalidations drawable.setCallback(this); - } else { - // Clear our bounds - setBounds(0, 0, 0, 0); } - mDrawable = drawable; - // Invalidate ourselves invalidateSelf(); } |
