mirror of
https://github.com/FossifyOrg/Gallery.git
synced 2024-11-26 22:47:59 +01:00
catch exceptions at creating nomedia files on sd cards
This commit is contained in:
parent
e53d6a5c20
commit
2c73864d74
1 changed files with 6 additions and 2 deletions
|
@ -218,7 +218,11 @@ fun SimpleActivity.addNoMedia(path: String, callback: () -> Unit) {
|
|||
|
||||
if (needsStupidWritePermissions(path)) {
|
||||
handleSAFDialog(file) {
|
||||
getFileDocument(path)?.createFile("", NOMEDIA)
|
||||
try {
|
||||
getFileDocument(path)?.createFile("", NOMEDIA)
|
||||
} catch (e: Exception) {
|
||||
toast(R.string.unknown_error_occurred)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
try {
|
||||
|
@ -228,7 +232,7 @@ fun SimpleActivity.addNoMedia(path: String, callback: () -> Unit) {
|
|||
}
|
||||
}
|
||||
scanFile(file) {
|
||||
callback.invoke()
|
||||
callback()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue