Просмотр исходного кода

Avoid crashing on empty q_items.

default 3 лет назад
Родитель
Сommit
a63c9c24c1
1 измененных файлов с 5 добавлено и 0 удалено
  1. 5 0
      activitypub.c

+ 5 - 0
activitypub.c

@@ -341,6 +341,11 @@ void process_queue(snac *snac)
         xs *q_item = dequeue(snac, fn);
         char *type;
 
+        if (q_item == NULL) {
+            snac_log(snac, xs_fmt("process_queue q_item error"));
+            continue;
+        }
+
         if ((type = xs_dict_get(q_item, "type")) == NULL)
             type = "output";