Merge branch 'MDL-47481-master' of https://github.com/sammarshallou/moodle
[moodle.git] / availability / condition / profile / classes / condition.php
index a156e4b..b781257 100644 (file)
@@ -449,6 +449,11 @@ class condition extends \core_availability\condition {
             \core_availability\capability_checker $checker) {
         global $CFG, $DB;
 
+        // If the array is empty already, just return it.
+        if (!$users) {
+            return $users;
+        }
+
         // Get all users from the list who match the condition.
         list ($sql, $params) = $DB->get_in_or_equal(array_keys($users));