File tree Expand file tree Collapse file tree 1 file changed +16
-6
lines changed
JetPDFVue/src/main/java/com/pratikk/jetpdfvue/state Expand file tree Collapse file tree 1 file changed +16
-6
lines changed Original file line number Diff line number Diff line change @@ -159,11 +159,15 @@ class VueFilePicker {
159159 onError(e)
160160 null
161161 }
162- file?.let {
163- interceptResult(it)
164- if (isActive) {
165- onResult(file)
162+ try {
163+ file?.let {
164+ interceptResult(it)
165+ if (isActive) {
166+ onResult(file)
167+ }
166168 }
169+ } catch (e: Exception ) {
170+ onError(e)
167171 }
168172 }
169173 }.apply {
@@ -185,8 +189,14 @@ class VueFilePicker {
185189 // Other sources
186190 VueFilePickerState .VueFilePickerImported (uri)
187191 } else {
188- // From Camera
189- VueFilePickerState .VueFilePickerImported (importFile!! .toUri())
192+ try {
193+ val uriFile = importFile!! .toUri()
194+ // From Camera
195+ VueFilePickerState .VueFilePickerImported (uriFile)
196+ } catch (e: Exception ) {
197+ onError(e)
198+ VueFilePickerState .VueFilePickerIdeal
199+ }
190200 }
191201 } else {
192202 VueFilePickerState .VueFilePickerIdeal
You can’t perform that action at this time.
0 commit comments