summaryrefslogtreecommitdiff
path: root/html.c
diff options
context:
space:
mode:
authordefault <nobody@localhost>2022-11-02 20:28:40 +0100
committerdefault <nobody@localhost>2022-11-02 20:28:40 +0100
commitdbe60be4f3818336e7e91c6153fcf846303eed04 (patch)
tree13f52fe3a0f8eecb9ee3ba984a76eabf829d8c17 /html.c
parent38509f5e142511f494ed33625a25d87059c6e369 (diff)
Fixed bug when following by @user@host.
Diffstat (limited to 'html.c')
-rw-r--r--html.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/html.c b/html.c
index a6d131d..afeb5df 100644
--- a/html.c
+++ b/html.c
@@ -1197,12 +1197,14 @@ int html_post_handler(d_char *req, char *q_path, d_char *payload, int p_size,
if (strcmp(action, L("Follow")) == 0) {
xs *msg = msg_follow(&snac, actor);
- /* reload the actor from the message, in may be different */
- actor = xs_dict_get(msg, "object");
+ if (msg != NULL) {
+ /* reload the actor from the message, in may be different */
+ actor = xs_dict_get(msg, "object");
- following_add(&snac, actor, msg);
+ following_add(&snac, actor, msg);
- enqueue_output(&snac, msg, actor, 0);
+ enqueue_output(&snac, msg, actor, 0);
+ }
}
else
if (strcmp(action, L("Unfollow")) == 0) {