summaryrefslogtreecommitdiffstats
path: root/src/com/android/gallery3d/filtershow/pipeline
diff options
context:
space:
mode:
authorkaiyiz <kaiyiz@codeaurora.org>2014-07-16 10:39:21 +0800
committerGerrit - the friendly Code Review server <code-review@localhost>2014-12-03 00:22:49 -0800
commit1935f4c5db2ec505a7780958b2f76366fde851c5 (patch)
treee6aa8f76c43e8fc209b407e9877e254f29112873 /src/com/android/gallery3d/filtershow/pipeline
parent9897fb2d0072f942520b312514c85de7d43d8dd2 (diff)
downloadandroid_packages_apps_Gallery2-1935f4c5db2ec505a7780958b2f76366fde851c5.tar.gz
android_packages_apps_Gallery2-1935f4c5db2ec505a7780958b2f76366fde851c5.tar.bz2
android_packages_apps_Gallery2-1935f4c5db2ec505a7780958b2f76366fde851c5.zip
Gallery2: Fix monkey test fail
When click undo in filtershowActivity,the position can't be -1 In FilterShowActivity,the preset and Rect shouldn't be null. Add some check for position and null pointer check for preset and rect CRs-fixed: 693810 Change-Id: I70fa2ff86d40ad483474b60ab9071ccb151bd445
Diffstat (limited to 'src/com/android/gallery3d/filtershow/pipeline')
-rw-r--r--src/com/android/gallery3d/filtershow/pipeline/ImagePreset.java8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/com/android/gallery3d/filtershow/pipeline/ImagePreset.java b/src/com/android/gallery3d/filtershow/pipeline/ImagePreset.java
index 4765a5990..e2945e9b9 100644
--- a/src/com/android/gallery3d/filtershow/pipeline/ImagePreset.java
+++ b/src/com/android/gallery3d/filtershow/pipeline/ImagePreset.java
@@ -67,9 +67,11 @@ public class ImagePreset {
}
public ImagePreset(ImagePreset source) {
- for (int i = 0; i < source.mFilters.size(); i++) {
- FilterRepresentation sourceRepresentation = source.mFilters.elementAt(i);
- mFilters.add(sourceRepresentation.copy());
+ if (source != null && source.mFilters != null) {
+ for (int i = 0; i < source.mFilters.size(); i++) {
+ FilterRepresentation sourceRepresentation = source.mFilters.elementAt(i);
+ mFilters.add(sourceRepresentation.copy());
+ }
}
}