Ver código fonte

Fixed an error in emptying hashtags from the web UI.

grunfink 4 meses atrás
pai
commit
d48b7544a0
1 arquivos alterados com 6 adições e 0 exclusões
  1. 6 0
      html.c

+ 6 - 0
html.c

@@ -5981,6 +5981,9 @@ int html_post_handler(const xs_dict *req, const char *q_path,
     if (p_path && strcmp(p_path, "admin/followed-hashtags") == 0) { /** **/
         const char *followed_hashtags = xs_dict_get(p_vars, "followed_hashtags");
 
+        if (xs_is_null(followed_hashtags))
+            followed_hashtags = "";
+
         if (xs_is_string(followed_hashtags)) {
             xs *new_hashtags = xs_list_new();
             xs *l = xs_split(followed_hashtags, "\n");
@@ -6017,6 +6020,9 @@ int html_post_handler(const xs_dict *req, const char *q_path,
     if (p_path && strcmp(p_path, "admin/blocked-hashtags") == 0) { /** **/
         const char *hashtags = xs_dict_get(p_vars, "blocked_hashtags");
 
+        if (xs_is_null(hashtags))
+            hashtags = "";
+
         if (xs_is_string(hashtags)) {
             xs *new_hashtags = xs_list_new();
             xs *l = xs_split(hashtags, "\n");