From 0af0f0f0740fc4914c4c13e232f88b8304173c76 Mon Sep 17 00:00:00 2001 From: Robin Watts Date: Thu, 26 Mar 2015 00:01:49 +0000 Subject: 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. --- platform/android/src/com/artifex/mupdfdemo/MuPDFActivity.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'platform/android/src/com/artifex') 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); } -- cgit v1.2.3