Skip to content

Commit

Permalink
Merged PR JoanZapata#134
Browse files Browse the repository at this point in the history
  • Loading branch information
bozapro committed May 23, 2016
1 parent 6baf130 commit 7d3f99d
Showing 1 changed file with 8 additions and 3 deletions.
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

0 comments on commit 7d3f99d

Please sign in to comment.