]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
Json ',' fix...
authorVsevolod Stakhov <vsevolod@rambler-co.ru>
Sun, 6 Jan 2013 16:48:32 +0000 (20:48 +0400)
committerVsevolod Stakhov <vsevolod@rambler-co.ru>
Sun, 6 Jan 2013 16:48:32 +0000 (20:48 +0400)
src/webui.c

index 04b9014cf15cdb06396e8065d54eec3b371bac97..5e6d037c0b37e8be2d84dd8fc28fda2146c22836 100644 (file)
@@ -414,9 +414,12 @@ http_handle_maps (struct evhttp_request *req, gpointer arg)
                                if (cur->next) {
                                        next = cur->next->data;
                                }
+                               else {
+                                       next = NULL;
+                               }
                                evbuffer_add_printf (evb, "{\"map\":%u,\"description\":\"%s\",\"editable\":%s%s",
                                                map->id, map->description, editable ? "true" : "false",
-                                               (next->protocol == MAP_PROTO_FILE && next->description)  ? "}," : "}");
+                                               (next && next->protocol == MAP_PROTO_FILE && next->description)  ? "}," : "}");
                        }
                }
                cur = g_list_next (cur);