summaryrefslogtreecommitdiff
path: root/platform/android/src/com/artifex
diff options
context:
space:
mode:
authorRobin Watts <robin.watts@artifex.com>2015-03-26 00:01:49 +0000
committerRobin Watts <robin.watts@artifex.com>2015-03-26 10:15:08 +0000
commit0af0f0f0740fc4914c4c13e232f88b8304173c76 (patch)
tree710c041e394ccbd53529de03b96be6b60c45f577 /platform/android/src/com/artifex
parent51a8632024cf03b1b293def102a96c6c05b62467 (diff)
downloadmupdf-0af0f0f0740fc4914c4c13e232f88b8304173c76.tar.xz
Bug 695811: Adopt Freds patch for Android crashes with strange filenames.
I can't claim to entirely understand why one formulation works and the other doesn't, but it seems a harmless enough fix that apparently works.
Diffstat (limited to 'platform/android/src/com/artifex')
-rw-r--r--platform/android/src/com/artifex/mupdfdemo/MuPDFActivity.java6
1 files changed, 5 insertions, 1 deletions
diff --git a/platform/android/src/com/artifex/mupdfdemo/MuPDFActivity.java b/platform/android/src/com/artifex/mupdfdemo/MuPDFActivity.java
index 681ea317..58ea1aa3 100644
--- a/platform/android/src/com/artifex/mupdfdemo/MuPDFActivity.java
+++ b/platform/android/src/com/artifex/mupdfdemo/MuPDFActivity.java
@@ -317,7 +317,11 @@ public class MuPDFActivity extends Activity implements FilePicker.FilePickerSupp
if (buffer != null) {
core = openBuffer(buffer, intent.getType());
} else {
- core = openFile(Uri.decode(uri.getEncodedPath()));
+ String path = Uri.decode(uri.getEncodedPath());
+ if (path == null) {
+ path = uri.toString();
+ }
+ core = openFile(path);
}
SearchTaskResult.set(null);
}