diff options
author | Robin Watts <robin.watts@artifex.com> | 2016-06-08 11:47:07 +0100 |
---|---|---|
committer | Robin Watts <robin.watts@artifex.com> | 2016-06-08 11:49:24 +0100 |
commit | fea0f8467f983cc5c1075d19787a4b398d0d5e22 (patch) | |
tree | 75747ad010140bc0ae45b441e78d3481d80fc457 /platform/android/viewer/src/com | |
parent | d74b2a68e0accddacca02b4993589502e1a7679b (diff) | |
download | mupdf-fea0f8467f983cc5c1075d19787a4b398d0d5e22.tar.xz |
Bug 696826: Android Viewer: Cope with null item
It seems that we can end up with a null item in MuPDFReaderView
onSingleTap. Add some simple checks to avoid this.
Diffstat (limited to 'platform/android/viewer/src/com')
-rw-r--r-- | platform/android/viewer/src/com/artifex/mupdfdemo/MuPDFReaderView.java | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/platform/android/viewer/src/com/artifex/mupdfdemo/MuPDFReaderView.java b/platform/android/viewer/src/com/artifex/mupdfdemo/MuPDFReaderView.java index f2d7f8fe..b712cba9 100644 --- a/platform/android/viewer/src/com/artifex/mupdfdemo/MuPDFReaderView.java +++ b/platform/android/viewer/src/com/artifex/mupdfdemo/MuPDFReaderView.java @@ -69,8 +69,9 @@ public class MuPDFReaderView extends ReaderView { if (mMode == Mode.Viewing && !tapDisabled) { MuPDFView pageView = (MuPDFView) getDisplayedView(); - Hit item = pageView.passClickEvent(e.getX(), e.getY()); - onHit(item); + Hit item = pageView != null ? pageView.passClickEvent(e.getX(), e.getY()) : null; + if (item != null) + onHit(item); if (item == Hit.Nothing) { if (mLinksEnabled && pageView != null && (link = pageView.hitLink(e.getX(), e.getY())) != null) { |