Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,14 @@ public DecodingAsyncTask(Uri uri, PDFView pdfView) {

@Override
protected Void doInBackground(Void... params) {
decodeService = new DecodeServiceBase(new PdfContext());
decodeService.setContentResolver(pdfView.getContext().getContentResolver());
decodeService.open(uri);
try {
decodeService = new DecodeServiceBase(new PdfContext());
decodeService.setContentResolver(pdfView.getContext().getContentResolver());
decodeService.open(uri);
} catch (Exception e){
// Prevent java.lang.RuntimeException: PDF file is corrupted
this.cancelled = true;
}
return null;
}

Expand Down