From 9e00b5389fe386479c4bd880434f86f66c44b613 Mon Sep 17 00:00:00 2001 From: Paul Gardiner Date: Thu, 16 Aug 2012 11:30:10 +0100 Subject: Android: fix divide by zero error --- android/src/com/artifex/mupdf/MuPDFActivity.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'android/src') diff --git a/android/src/com/artifex/mupdf/MuPDFActivity.java b/android/src/com/artifex/mupdf/MuPDFActivity.java index fb3c4552..c530b01b 100644 --- a/android/src/com/artifex/mupdf/MuPDFActivity.java +++ b/android/src/com/artifex/mupdf/MuPDFActivity.java @@ -305,7 +305,7 @@ public class MuPDFActivity extends Activity makeButtonsView(); // Set up the page slider - int smax = core.countPages()-1; + int smax = Math.max(core.countPages()-1,1); mPageSliderRes = ((10 + smax - 1)/smax) * 2; // Set the file-name text -- cgit v1.2.3