commit cf980ba

default  ·  2024-11-07 22:23:10 +0000 UTC
parent b2555fb
Fixed crash in posts from the links browser.
1 files changed,  +1, -1
+1, -1
1@@ -196,7 +196,7 @@ xs_dict *xs_multipart_form_data(const char *payload, int p_size, const char *hea
2         if (fn != NULL) {
3             /* p_var value is a list */
4             /* if filename has no extension and content-type is image, attach extension to the filename */
5-            if (strchr(fn, '.') == NULL && xs_startswith(ct, "image/")) {
6+            if (strchr(fn, '.') == NULL && ct && xs_startswith(ct, "image/")) {
7                 char *ext = strchr(ct, '/');
8                 ext++;
9                 fn = xs_str_cat(xs_str_new(""), fn, ".", ext);