From d8cdb8cc2ca509e48cc468bd60c12f08eeeb2e39 Mon Sep 17 00:00:00 2001 From: George Mount Date: Mon, 12 May 2014 16:44:14 -0700 Subject: [PATCH] Check for null Drawable in MoveImage Bug 14676155 Change-Id: Ic8d2c3fc471a876f5369e743e60ffb0f238f3eed --- core/java/android/transition/MoveImage.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/core/java/android/transition/MoveImage.java b/core/java/android/transition/MoveImage.java index 183cdd2397a89..6f1b6f7374940 100644 --- a/core/java/android/transition/MoveImage.java +++ b/core/java/android/transition/MoveImage.java @@ -64,7 +64,13 @@ public class MoveImage extends Transition { if (!(view instanceof ImageView) || view.getVisibility() != View.VISIBLE) { return; } + ImageView imageView = (ImageView) view; + Drawable drawable = imageView.getDrawable(); + if (drawable == null) { + return; + } Map values = transitionValues.values; + values.put(PROPNAME_DRAWABLE, drawable); ViewGroup parent = (ViewGroup) view.getParent(); parent.getLocationInWindow(mTempLoc); @@ -79,11 +85,9 @@ public class MoveImage extends Transition { Rect bounds = new Rect(left, top, right, bottom); values.put(PROPNAME_BOUNDS, bounds); - ImageView imageView = (ImageView) view; Matrix matrix = getMatrix(imageView); values.put(PROPNAME_MATRIX, matrix); values.put(PROPNAME_CLIP, findClip(imageView)); - values.put(PROPNAME_DRAWABLE, imageView.getDrawable()); } @Override