diff options
author | huiyan <huiyan@codeaurora.org> | 2016-05-05 11:33:07 +0800 |
---|---|---|
committer | Likai Ding <likaid@codeaurora.org> | 2016-06-14 14:42:58 +0800 |
commit | 53796278b835579edcc04c086cedf5a954e28a67 (patch) | |
tree | 85b2d4c5e4e95db83cfc6b79a131d376152004b6 /src/com/android/gallery3d/ui | |
parent | 77504adebce4b8bb8233eefbede7a3d2bfafd0a0 (diff) | |
download | android_packages_apps_Gallery2-53796278b835579edcc04c086cedf5a954e28a67.tar.gz android_packages_apps_Gallery2-53796278b835579edcc04c086cedf5a954e28a67.tar.bz2 android_packages_apps_Gallery2-53796278b835579edcc04c086cedf5a954e28a67.zip |
Gallery2: Fix force close when copy pictures from PC to DUT
When copying pictures IndexOutOfBoundsException occur,
and the reference is null before invoking it.
Make sure the index is not out bounds.
Determine whether the reference is null before invoking it.
Change-Id: I35752c2fee23efd092e0bb2171d0e50cb6110bad
CRs-Fixed: 1002766
Diffstat (limited to 'src/com/android/gallery3d/ui')
-rw-r--r-- | src/com/android/gallery3d/ui/TimeLineSlotView.java | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/com/android/gallery3d/ui/TimeLineSlotView.java b/src/com/android/gallery3d/ui/TimeLineSlotView.java index bac5a0e4d..329ea75e3 100644 --- a/src/com/android/gallery3d/ui/TimeLineSlotView.java +++ b/src/com/android/gallery3d/ui/TimeLineSlotView.java @@ -459,9 +459,12 @@ public class TimeLineSlotView extends GLView { Rect offset = new Rect(); rootPane.getBoundsOf(this, offset); Rect r = getSlotRect(slotIndex); - r.offset(offset.left - getScrollX(), - offset.top - getScrollY()); - return r; + if (r != null) { + r.offset(offset.left - getScrollX(), + offset.top - getScrollY()); + return r; + } + return offset; } public int getTitleWidth() { |