From 86fe77834c40390d440e11236b33594a96e4c7fe Mon Sep 17 00:00:00 2001 From: tibbi Date: Wed, 13 Mar 2019 11:44:13 +0100 Subject: [PATCH] catching an exception at storing path in db --- .../com/simplemobiletools/gallery/pro/extensions/Context.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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() }