# HG changeset patch # User Olaf Wintermann # Date 1688287707 -7200 # Node ID f4acc783f25e8823b09db356c73b6abc51e3525c # Parent c4993f0991e434f5179c92b61af531e886fdf03f fix tag filter crash diff -r c4993f0991e4 -r f4acc783f25e dav/sync.c --- a/dav/sync.c Sun Jul 02 10:37:44 2023 +0200 +++ b/dav/sync.c Sun Jul 02 10:48:27 2023 +0200 @@ -469,9 +469,11 @@ DavBool changed = 0; CxList *res_tags = sync_get_file_tags(dir, res, &changed, NULL); + if(!res_tags) { + res_tags = cxEmptyList; + } int ret = matches_tagfilter(res_tags, tagfilter); - CxIterator i = cxListIterator(res_tags); cxListDestroy(res_tags); return ret; } diff -r c4993f0991e4 -r f4acc783f25e dav/tags.c --- a/dav/tags.c Sun Jul 02 10:37:44 2023 +0200 +++ b/dav/tags.c Sun Jul 02 10:48:27 2023 +0200 @@ -110,6 +110,10 @@ } CxMap* taglist2map(CxList *tags) { + if(!tags) { + return cxHashMapCreate(cxDefaultAllocator, CX_STORE_POINTERS, 8); + } + CxMap *map = cxHashMapCreate(cxDefaultAllocator, CX_STORE_POINTERS, tags->size + 8); CxIterator iter = cxListIterator(tags); cx_foreach(DavTag*, t, iter) {