Skip to content

Commit b68a60f

Browse files
committed
Fix crash when opening a PDF, when the ResourceDataProvider is not used while initializing
1 parent 4653ec1 commit b68a60f

File tree

1 file changed

+3
-1
lines changed
  • readium/adapters/pspdfkit/document/src/main/java/org/readium/adapter/pspdfkit/document

1 file changed

+3
-1
lines changed

readium/adapters/pspdfkit/document/src/main/java/org/readium/adapter/pspdfkit/document/PsPdfKitDocument.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,9 @@ public class PsPdfKitDocumentFactory(context: Context) : PdfDocumentFactory<PsPd
4747
} catch (e: InvalidSignatureException) {
4848
Try.failure(ReadError.Decoding(ThrowableError(e)))
4949
} catch (e: IOException) {
50-
Try.failure(dataProvider.error!!)
50+
Try.failure(dataProvider.error
51+
?: ReadError.UnsupportedOperation(ThrowableError(IllegalStateException(e)))
52+
)
5153
}
5254
}
5355
}

0 commit comments

Comments
 (0)