From 02e1fb8319ee4725523b66c715773f9bc4cb2351 Mon Sep 17 00:00:00 2001 From: Claude Brisson Date: Wed, 24 Jul 2024 09:11:52 +0200 Subject: [PATCH] Bugfix tournament deletion --- .../src/main/kotlin/org/jeudego/pairgoth/store/FileStore.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api-webapp/src/main/kotlin/org/jeudego/pairgoth/store/FileStore.kt b/api-webapp/src/main/kotlin/org/jeudego/pairgoth/store/FileStore.kt index 90a8a7f..c92b4a2 100644 --- a/api-webapp/src/main/kotlin/org/jeudego/pairgoth/store/FileStore.kt +++ b/api-webapp/src/main/kotlin/org/jeudego/pairgoth/store/FileStore.kt @@ -162,7 +162,7 @@ class FileStore(pathStr: String): Store { val file = path.resolve(filename).toFile() if (!file.exists()) throw Error("File $filename does not exist") val history = path.resolve("history").toFile() - if (!history.exists() || !history.mkdir()) { + if (!history.exists() && !history.mkdir()) { throw Error("cannot create 'history' sub-directory") } file.renameTo(path.resolve("history/${filename}-${timestamp}").toFile())