diff --git a/exportlib.php b/exportlib.php index 3bc98af1..0a2b3341 100644 --- a/exportlib.php +++ b/exportlib.php @@ -659,7 +659,8 @@ public function get_header(scheduler $scheduler) { * @return string the value of this field for the given data */ public function get_value(slot $slot, $appointment) { - if (!$appointment instanceof appointment || $appointment->studentid == 0) { + if (!$appointment instanceof appointment || $appointment->studentid == 0 + || !context_user::instance($appointment->studentid, IGNORE_MISSING)) { return ''; } $this->field->set_userid($appointment->studentid);