diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/activity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/activity.kt index 5fa1540ce..fc9892059 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/activity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/activity.kt @@ -170,7 +170,11 @@ fun SimpleActivity.addNoMedia(path: String, callback: () -> Unit) { getFileDocument(path)?.createFile("", NOMEDIA) } } else { - file.createNewFile() + try { + file.createNewFile() + } catch (e: Exception) { + toast(R.string.unknown_error_occurred) + } } scanFile(file) { callback.invoke()