From 402eb61f7986df7cdb31b8df92f05afd1d02a487 Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 10 Jun 2019 23:53:37 +0200 Subject: [PATCH] catch exceptions thrown at updating db directories --- .../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 a3dfdda6f..243298224 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 @@ -664,7 +664,10 @@ fun Context.updateDBMediaPath(oldPath: String, newPath: String) { } fun Context.updateDBDirectory(directory: Directory, directoryDao: DirectoryDao) { - directoryDao.updateDirectory(directory.path, directory.tmb, directory.mediaCnt, directory.modified, directory.taken, directory.size, directory.types) + try { + directoryDao.updateDirectory(directory.path, directory.tmb, directory.mediaCnt, directory.modified, directory.taken, directory.size, directory.types) + } catch (ignored: Exception) { + } } fun Context.getFavoritePaths(): ArrayList {