diff options
| author | Jakob L. Kreuze | 2023-03-11 19:33:53 -0500 |
|---|---|---|
| committer | Jakob L. Kreuze | 2023-03-11 19:34:00 -0500 |
| commit | 6463a9f09032f22c8e39ccea757b8a7054f199ba (patch) | |
| tree | 38df169fa643db622c23959f077927e18dfc8f55 /haunt/jakob/dynamic/capabilities | |
| parent | 32e642f3789d163fae18824ec04e7e833713b26c (diff) | |
Guard against non-emoji reactions
Diffstat (limited to 'haunt/jakob/dynamic/capabilities')
| -rw-r--r-- | haunt/jakob/dynamic/capabilities/comments.scm | 3 |
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))))))) |