Merge branch 'MDL-68315-master' of https://github.com/kabalin/moodle
[moodle.git] / lib / form / course.php
index 8bc172e..a26dcdf 100644 (file)
@@ -125,7 +125,7 @@ class MoodleQuickForm_course extends MoodleQuickForm_autocomplete {
         $coursestofetch = array();
 
         foreach ($values as $onevalue) {
-            if ((!$this->optionExists($onevalue)) &&
+            if ($onevalue && !$this->optionExists($onevalue) &&
                     ($onevalue !== '_qf__force_multiselect_submission')) {
                 array_push($coursestofetch, $onevalue);
             }