summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkaiyiz <kaiyiz@codeaurora.org>2014-04-14 10:52:02 +0800
committeremancebo <emancebo@cyngn.com>2014-09-04 10:40:20 -0700
commitac95683211eceaec9f9c2a6611224f7f518b4fb5 (patch)
treefa182de8de94bf2125e79586e4395d1a26c83d56
parentb8858291c305e6ce666bb2bfb46ea49779466009 (diff)
downloadandroid_packages_apps_Gallery2-ac95683211eceaec9f9c2a6611224f7f518b4fb5.tar.gz
android_packages_apps_Gallery2-ac95683211eceaec9f9c2a6611224f7f518b4fb5.tar.bz2
android_packages_apps_Gallery2-ac95683211eceaec9f9c2a6611224f7f518b4fb5.zip
Gallery2: Fix Gallery2 ANR when run monkey
When we create ExportDialog View,a null pointer is used to reset mOriginalBounds which cause this bug happened. Add a condition when judge conditon is null,then not to reset mOriginalBounds to avoid this bug. CRs-fixed: 647207 Change-Id: If91434c3ca15a287600097b7a5ec8c5aa7d7d6e2
-rw-r--r--src/com/android/gallery3d/filtershow/ui/ExportDialog.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/com/android/gallery3d/filtershow/ui/ExportDialog.java b/src/com/android/gallery3d/filtershow/ui/ExportDialog.java
index b42c9f367..579067c64 100644
--- a/src/com/android/gallery3d/filtershow/ui/ExportDialog.java
+++ b/src/com/android/gallery3d/filtershow/ui/ExportDialog.java
@@ -107,8 +107,10 @@ public class ExportDialog extends DialogFragment implements View.OnClickListener
mOriginalBounds = MasterImage.getImage().getOriginalBounds();
ImagePreset preset = MasterImage.getImage().getPreset();
- mOriginalBounds = preset.finalGeometryRect(mOriginalBounds.width(),
- mOriginalBounds.height());
+ if (preset != null) {
+ mOriginalBounds = preset.finalGeometryRect(mOriginalBounds.width(),
+ mOriginalBounds.height());
+ }
mRatio = mOriginalBounds.width() / (float) mOriginalBounds.height();
mWidthText.setText("" + mOriginalBounds.width());
mHeightText.setText("" + mOriginalBounds.height());