From cb5455c990fc720ff9df1be56934c33e78c8062c Mon Sep 17 00:00:00 2001 From: FooIbar <118464521+FooIbar@users.noreply.github.com> Date: Thu, 17 Jul 2025 17:43:40 +0800 Subject: [PATCH] Fix corrupted tag database file not updating --- .../kotlin/com/hippo/ehviewer/client/EhTagDatabase.kt | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/src/main/kotlin/com/hippo/ehviewer/client/EhTagDatabase.kt b/app/src/main/kotlin/com/hippo/ehviewer/client/EhTagDatabase.kt index 2c6e1cb53..a8ea671a0 100644 --- a/app/src/main/kotlin/com/hippo/ehviewer/client/EhTagDatabase.kt +++ b/app/src/main/kotlin/com/hippo/ehviewer/client/EhTagDatabase.kt @@ -177,9 +177,11 @@ object EhTagDatabase : CoroutineScope { } } - val currentSha1 = Either.catch { - sha1File.utf8() - }.getOrNull() + val currentSha1 = if (initialized) { + Either.catch { sha1File.utf8() }.getOrNull() + } else { + null + } val newSha1 = fetch(sha1Url) if (newSha1 == currentSha1) return