aboutsummaryrefslogtreecommitdiff
path: root/haunt/jakob/dynamic/capabilities
diff options
context:
space:
mode:
Diffstat (limited to 'haunt/jakob/dynamic/capabilities')
-rw-r--r--haunt/jakob/dynamic/capabilities/comments.scm3
1 files changed, 2 insertions, 1 deletions
diff --git a/haunt/jakob/dynamic/capabilities/comments.scm b/haunt/jakob/dynamic/capabilities/comments.scm
index 1da8abb..996c549 100644
--- a/haunt/jakob/dynamic/capabilities/comments.scm
+++ b/haunt/jakob/dynamic/capabilities/comments.scm
@@ -194,7 +194,8 @@ This is a wrapper around `get-comments-by-slug'."
(let* ((id (assoc-value form-data "id"))
(reaction (assoc-value form-data "reaction"))
(reactions (comment-reactions id)))
- (unless reactions (panic "no such comment"))
+ (unless id (panic "no such comment"))
+ (unless (emoji? reaction) (panic "invalid reaction"))
(set-reactions id (add-reaction reactions reaction))
(values '((content-type . (application/json)))
(scm->json-string `((success . #t)))))))

© 2015 - 2026 Jakob L. Kreuze