Skip to content

Commit

Permalink
Fixed for issue in Gallery during monkey test run.
Browse files Browse the repository at this point in the history
Observing following crash during monkey test run
java.lang.NullPointerException: Attempt to invoke virtual method
'java.util.Collection.com.android.gallery3d.filtershow.pipeline
.ImagePreset.getGeometryFilters()' on a null object reference

Check for null condition.

Tests: Launch Gallery app, open some image to edit.

Tracked-On: OAM-128848
Signed-off-by: Ankit Agrawal <[email protected]>
Signed-off-by: Xu Bing <[email protected]>
  • Loading branch information
XuBing0 committed Dec 30, 2024
1 parent 7c1eae7 commit e26b48a
Showing 1 changed file with 37 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
From e00569e8d1eeccfec8f22111f0e401e3b5786c61 Mon Sep 17 00:00:00 2001
From: Ankit Agrawal <[email protected]>
Date: Thu, 4 Apr 2024 10:05:11 +0530
Subject: [PATCH] Fixed for issue in Gallery during monkey test run.

Observing following crash during monkey test run
java.lang.NullPointerException: Attempt to invoke virtual method
'java.util.Collection.com.android.gallery3d.filtershow.pipeline
.ImagePreset.getGeometryFilters()' on a null object reference

Check for null condition.

Tests: Launch Gallery app, open some image to edit.

Tracked-On: OAM-128848
Signed-off-by: Ankit Agrawal <[email protected]>
Signed-off-by: Xu Bing <[email protected]>
---
.../android/gallery3d/filtershow/imageshow/PrimaryImage.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/com/android/gallery3d/filtershow/imageshow/PrimaryImage.java b/src/com/android/gallery3d/filtershow/imageshow/PrimaryImage.java
index 63e683a1d..983327e7a 100644
--- a/src/com/android/gallery3d/filtershow/imageshow/PrimaryImage.java
+++ b/src/com/android/gallery3d/filtershow/imageshow/PrimaryImage.java
@@ -571,7 +571,7 @@ public class PrimaryImage implements RenderingRequestCaller {
public Matrix computeImageToScreen(Bitmap bitmapToDraw,
float rotate,
boolean applyGeometry) {
- if (getOriginalBounds() == null
+ if (mPreset == null || getOriginalBounds() == null
|| mImageShowSize.x == 0
|| mImageShowSize.y == 0) {
return null;
--
2.34.1

0 comments on commit e26b48a

Please sign in to comment.