mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 17:06:53 +02:00
MDL-63850 core_message: prevent exception being thrown with empty array
This commit is contained in:
parent
308eb72448
commit
6981de1080
1 changed files with 5 additions and 0 deletions
|
@ -489,6 +489,11 @@ class helper {
|
||||||
public static function get_member_info(int $referenceuserid, array $userids) : array {
|
public static function get_member_info(int $referenceuserid, array $userids) : array {
|
||||||
global $DB, $PAGE;
|
global $DB, $PAGE;
|
||||||
|
|
||||||
|
// Prevent exception being thrown when array is empty.
|
||||||
|
if (empty($userids)) {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
|
||||||
list($useridsql, $usersparams) = $DB->get_in_or_equal($userids);
|
list($useridsql, $usersparams) = $DB->get_in_or_equal($userids);
|
||||||
$userfields = \user_picture::fields('u', array('lastaccess'));
|
$userfields = \user_picture::fields('u', array('lastaccess'));
|
||||||
$userssql = "SELECT $userfields, u.deleted, mc.id AS contactid, mub.id AS blockedid
|
$userssql = "SELECT $userfields, u.deleted, mc.id AS contactid, mub.id AS blockedid
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue