summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--graphics/java/android/graphics/Bitmap.java5
1 files changed, 4 insertions, 1 deletions
diff --git a/graphics/java/android/graphics/Bitmap.java b/graphics/java/android/graphics/Bitmap.java
index 1324311..2d8b0b2 100644
--- a/graphics/java/android/graphics/Bitmap.java
+++ b/graphics/java/android/graphics/Bitmap.java
@@ -1558,7 +1558,10 @@ public final class Bitmap implements Parcelable {
* If other is null, return false.
*/
public boolean sameAs(Bitmap other) {
- checkRecycled("Can't sameAs on a recycled bitmap!");
+ checkRecycled("Can't call sameAs on a recycled bitmap!");
+ if (other.isRecycled()) {
+ throw new IllegalArgumentException("Can't compare to a recycled bitmap!");
+ }
return this == other || (other != null
&& nativeSameAs(mFinalizer.mNativeBitmap, other.mFinalizer.mNativeBitmap));
}