add a try catch block around creating nomedia files on Android 4
This commit is contained in:
parent
da67107b83
commit
7cc41bb86e
1 changed files with 5 additions and 1 deletions
|
@ -170,7 +170,11 @@ fun SimpleActivity.addNoMedia(path: String, callback: () -> Unit) {
|
||||||
getFileDocument(path)?.createFile("", NOMEDIA)
|
getFileDocument(path)?.createFile("", NOMEDIA)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
file.createNewFile()
|
try {
|
||||||
|
file.createNewFile()
|
||||||
|
} catch (e: Exception) {
|
||||||
|
toast(R.string.unknown_error_occurred)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
scanFile(file) {
|
scanFile(file) {
|
||||||
callback.invoke()
|
callback.invoke()
|
||||||
|
|
Loading…
Reference in a new issue