diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/extensions/Context.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/extensions/Context.kt index 5969a070b..bd5b65f44 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/extensions/Context.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/extensions/Context.kt @@ -716,6 +716,9 @@ fun Context.addPathToDB(path: String) { val videoDuration = if (type == TYPE_VIDEOS) path.getVideoDuration() else 0 val medium = Medium(null, path.getFilenameFromPath(), path, path.getParentPath(), System.currentTimeMillis(), System.currentTimeMillis(), File(path).length(), type, videoDuration, false, 0L) - galleryDB.MediumDao().insert(medium) + try { + galleryDB.MediumDao().insert(medium) + } catch (ignored: Exception) { + } }.start() }