From c40977c3f0e74454d2959f4678f619a760d594f3 Mon Sep 17 00:00:00 2001 From: "me@ow.nekobit.net" Date: Tue, 12 Apr 2022 19:13:26 +0000 Subject: [PATCH] Skip empty array FossilOrigin-Name: 500e1438f9ca9ea2d505fe0e679765abace17b4f4494cbbb36687c7f5a956f02 --- src/query.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/query.c b/src/query.c index 8761530..c2cd69d 100644 --- a/src/query.c +++ b/src/query.c @@ -61,6 +61,11 @@ char* _mstdnt_query_string(mastodont_t* data, { escape_str = NULL; + /* If array is NULL, skip */ + if (params[i].type == _MSTDNT_QUERY_ARRAY && + !(params[i].value.a.arr && params[i].value.a.arr_len)) + continue; + /* Start up array */ if (params[i].type == _MSTDNT_QUERY_ARRAY && arr_ind == 0) {