diff --git a/src/controllers/web/NoteController.kt b/src/controllers/web/NoteController.kt index db7014c..1a38f6e 100644 --- a/src/controllers/web/NoteController.kt +++ b/src/controllers/web/NoteController.kt @@ -32,8 +32,13 @@ class NoteController( suspend fun renderOne(call: ApplicationCall) { val uuidParam = call.parameters["uuid"] - val uuid = UUID.fromString(uuidParam) - val note = noteRepository.find(userId = 1, noteUuid = uuid) + + val uuid = try { + UUID.fromString(uuidParam) + } catch (e: RuntimeException) { + return + } + val note = noteRepository.find(userId = 1, noteUuid = uuid) ?: return val template = templates.get("_uuid.html") call.respondKorte(template, "note" to note) }