summaryrefslogtreecommitdiff
path: root/html.c
diff options
context:
space:
mode:
authordefault <nobody@localhost>2022-12-03 20:45:58 +0100
committerdefault <nobody@localhost>2022-12-03 20:45:58 +0100
commitbd0149ee0d2b38d2aab97ef5096ca1a3cb529086 (patch)
tree5fed2dfb13a80d6be2f127d749b2c7f88ae8c392 /html.c
parent76bfc366eafb30975f8994497f9d6b74f4d36d55 (diff)
Don't try to admire empty messages.
Diffstat (limited to 'html.c')
-rw-r--r--html.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/html.c b/html.c
index b8bb1af..6f85c83 100644
--- a/html.c
+++ b/html.c
@@ -1288,14 +1288,20 @@ int html_post_handler(d_char *req, char *q_path, d_char *payload, int p_size,
if (strcmp(action, L("Like")) == 0) {
xs *msg = msg_admiration(&snac, id, "Like");
- post(&snac, msg);
- timeline_admire(&snac, msg, id, snac.actor, 1);
+
+ if (msg != NULL) {
+ post(&snac, msg);
+ timeline_admire(&snac, msg, id, snac.actor, 1);
+ }
}
else
if (strcmp(action, L("Boost")) == 0) {
xs *msg = msg_admiration(&snac, id, "Announce");
- post(&snac, msg);
- timeline_admire(&snac, msg, id, snac.actor, 0);
+
+ if (msg != NULL) {
+ post(&snac, msg);
+ timeline_admire(&snac, msg, id, snac.actor, 0);
+ }
}
else
if (strcmp(action, L("MUTE")) == 0) {