From 63f25f86d38542c989898680ee091f7eb2306353 Mon Sep 17 00:00:00 2001 From: irungentoo Date: Wed, 11 Jun 2014 09:18:14 -0400 Subject: [PATCH] Fixed segfault when logging was enabled. m->chats[c] can be NULL if more than one group chat is created and one of the first ones is deleted. --- toxcore/Messenger.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/toxcore/Messenger.c b/toxcore/Messenger.c index 358227a3..3d9b671d 100644 --- a/toxcore/Messenger.c +++ b/toxcore/Messenger.c @@ -2320,7 +2320,8 @@ void do_messenger(Messenger *m) size_t c; for (c = 0; c < m->numchats; c++) { - Assoc_status(m->chats[c]->assoc); + if (m->chats[c]) + Assoc_status(m->chats[c]->assoc); } }