add a try catch block around creating nomedia files on Android 4

This commit is contained in:
tibbi 2017-04-10 20:46:42 +02:00
parent da67107b83
commit 7cc41bb86e

View file

@ -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()