diff options
author | John Reck <jreck@google.com> | 2015-05-20 14:18:32 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2015-05-20 14:18:34 +0000 |
commit | b1f6aebb4aab9e5c90206e01d19b7eab3d512893 (patch) | |
tree | 60243a00786e6cdd01fb57f5f0e93645df20e57b /graphics | |
parent | 90ac386b4e4ee2679a2b7af83642ab74967c51e3 (diff) | |
parent | 3df4869a77bdeb72d5810bbcf7819ed1b8dd0ec7 (diff) | |
download | frameworks_base-b1f6aebb4aab9e5c90206e01d19b7eab3d512893.zip frameworks_base-b1f6aebb4aab9e5c90206e01d19b7eab3d512893.tar.gz frameworks_base-b1f6aebb4aab9e5c90206e01d19b7eab3d512893.tar.bz2 |
Merge "Fix Bitmap#sameAs NPE" into mnc-dev
Diffstat (limited to 'graphics')
-rw-r--r-- | graphics/java/android/graphics/Bitmap.java | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/graphics/java/android/graphics/Bitmap.java b/graphics/java/android/graphics/Bitmap.java index a999b71..8ad7c12 100644 --- a/graphics/java/android/graphics/Bitmap.java +++ b/graphics/java/android/graphics/Bitmap.java @@ -1575,11 +1575,12 @@ public final class Bitmap implements Parcelable { */ public boolean sameAs(Bitmap other) { checkRecycled("Can't call sameAs on a recycled bitmap!"); + if (this == other) return true; + if (other == null) return false; if (other.isRecycled()) { throw new IllegalArgumentException("Can't compare to a recycled bitmap!"); } - return this == other || (other != null - && nativeSameAs(mFinalizer.mNativeBitmap, other.mFinalizer.mNativeBitmap)); + return nativeSameAs(mFinalizer.mNativeBitmap, other.mFinalizer.mNativeBitmap); } /** |