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())