From e1fc36d197639ee13194de74b2e7e42c39b12286 Mon Sep 17 00:00:00 2001 From: sergeyv Date: Tue, 9 May 2017 16:36:09 -0700 Subject: [PATCH] Fix npe due to strict mode in Bitmap.sameAs bug:38164234 Test: none Change-Id: Ib267d1b06f86980202693fc1c330f73ed06411b0 --- graphics/java/android/graphics/Bitmap.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/graphics/java/android/graphics/Bitmap.java b/graphics/java/android/graphics/Bitmap.java index 8a36120d3158b..40d36aacf0351 100644 --- a/graphics/java/android/graphics/Bitmap.java +++ b/graphics/java/android/graphics/Bitmap.java @@ -1869,9 +1869,9 @@ public final class Bitmap implements Parcelable { public boolean sameAs(Bitmap other) { checkRecycled("Can't call sameAs on a recycled bitmap!"); noteHardwareBitmapSlowCall(); - other.noteHardwareBitmapSlowCall(); if (this == other) return true; if (other == null) return false; + other.noteHardwareBitmapSlowCall(); if (other.isRecycled()) { throw new IllegalArgumentException("Can't compare to a recycled bitmap!"); }