mirror of
https://github.com/gedoor/legado.git
synced 2024-07-04 23:36:56 +08:00
修复低版本手机打开本地文件出错的bug
This commit is contained in:
parent
707ead85d8
commit
609619412a
|
@ -35,7 +35,11 @@ object LocalBook {
|
|||
if (uri.isContentScheme()) {
|
||||
return appCtx.contentResolver.openInputStream(uri)!!
|
||||
}
|
||||
return FileInputStream(File(uri.path!!))
|
||||
val file = File(uri.path!!)
|
||||
if (file.exists()) {
|
||||
return FileInputStream(File(uri.path!!))
|
||||
}
|
||||
throw FileNotFoundException("${uri.path} 文件不存在")
|
||||
}
|
||||
|
||||
@Throws(Exception::class)
|
||||
|
|
Loading…
Reference in New Issue
Block a user