MDL-64931 core_message: fixed PHP error when users are deleted from DB

This commit is contained in:
Mark Nelson
2019-02-25 07:48:44 +08:00
parent 07203d34f1
commit 89bab5e8f0
2 changed files with 33 additions and 6 deletions
+7
View File
@@ -713,6 +713,13 @@ class api {
$members[$convid][$key]->canmessage = null;
$members[$convid][$key]->contactrequests = [];
}
} else { // Remove all members and individual conversations where we could not get the member's information.
unset($members[$convid][$key]);
// If the conversation is an individual conversation, then we should remove it from the list.
if ($conversations[$convid]->conversationtype == self::MESSAGE_CONVERSATION_TYPE_INDIVIDUAL) {
unset($conversations[$convid]);
}
}
}
}