From 90e9a40c7c7dda864162e08c591b594e2e7fde74 Mon Sep 17 00:00:00 2001 From: Jannik Reimers Date: Sat, 5 Apr 2025 22:02:29 +0200 Subject: [PATCH] erm maybe check if there is actually a doc in the db --- .../kotlin/dev/jansel/aglaea/extensions/SessionExtension.kt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/kotlin/dev/jansel/aglaea/extensions/SessionExtension.kt b/src/main/kotlin/dev/jansel/aglaea/extensions/SessionExtension.kt index ec48c19..a718d1b 100644 --- a/src/main/kotlin/dev/jansel/aglaea/extensions/SessionExtension.kt +++ b/src/main/kotlin/dev/jansel/aglaea/extensions/SessionExtension.kt @@ -28,7 +28,11 @@ class SessionExtension : Extension() { content = "Replay session disabled" } } else { - ConfigCollection().update(ConfigCollection().get()!!.copy(replaySession = true)) + if (ConfigCollection().get() == null) { + ConfigCollection().set(ConfigCollection().get()!!.copy(replaySession = true)) + } else { + ConfigCollection().update(ConfigCollection().get()!!.copy(replaySession = true)) + } respond { content = "Replay session enabled" }