summaryrefslogtreecommitdiff
path: root/toxcore
diff options
context:
space:
mode:
Diffstat (limited to 'toxcore')
-rw-r--r--toxcore/group_chats.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/toxcore/group_chats.c b/toxcore/group_chats.c
index b610e9a5..1ec8ede5 100644
--- a/toxcore/group_chats.c
+++ b/toxcore/group_chats.c
@@ -787,7 +787,10 @@ static void del_dead_peers(Group_Chat *chat)
787 delpeer(chat, i); 787 delpeer(chat, i);
788 } 788 }
789 789
790 if (chat->group != NULL && chat->group[i].deleted) { 790 if (chat->group == NULL || i >= chat->numpeers)
791 break;
792
793 if (chat->group[i].deleted) {
791 if (is_timeout(chat->group[i].deleted_time, DEL_PEER_DELAY)) 794 if (is_timeout(chat->group[i].deleted_time, DEL_PEER_DELAY))
792 delpeer(chat, i); 795 delpeer(chat, i);
793 } 796 }