diff options
author | Linux Build Service Account <lnxbuild@localhost> | 2016-04-07 02:27:43 -0700 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2016-04-07 02:27:43 -0700 |
commit | 486c32c42f7113e4bebc968d9a8e16b6f2f82eaf (patch) | |
tree | e183b65684d91e9c92cf0f9f8b6fea5a28643437 /src/com/android/gallery3d/ui | |
parent | fc2eb4862e6c48c406470cfc9885775dec76b0b7 (diff) | |
parent | 1162ee9c919127ce1a3bcc7fe0b0c275d6e616a8 (diff) | |
download | android_packages_apps_Gallery2-486c32c42f7113e4bebc968d9a8e16b6f2f82eaf.tar.gz android_packages_apps_Gallery2-486c32c42f7113e4bebc968d9a8e16b6f2f82eaf.tar.bz2 android_packages_apps_Gallery2-486c32c42f7113e4bebc968d9a8e16b6f2f82eaf.zip |
Merge "Gallery2: Fix NullPointerException when scroll pictures in TimeLine." into android_ui.lnx.1.2-dev
Diffstat (limited to 'src/com/android/gallery3d/ui')
-rw-r--r-- | src/com/android/gallery3d/ui/TimeLineSlotView.java | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/com/android/gallery3d/ui/TimeLineSlotView.java b/src/com/android/gallery3d/ui/TimeLineSlotView.java index 5c93d31bd..81fc3a57c 100644 --- a/src/com/android/gallery3d/ui/TimeLineSlotView.java +++ b/src/com/android/gallery3d/ui/TimeLineSlotView.java @@ -107,9 +107,10 @@ public class TimeLineSlotView extends GLView { return; } Rect rect = mLayout.getSlotRect(index); - int position = (rect.top + rect.bottom - getHeight()) / 2; - - setScrollPosition(position); + if (rect != null) { + int position = (rect.top + rect.bottom - getHeight()) / 2; + setScrollPosition(position); + } } public void makeSlotVisible(int index) { |