fix(Studium):checks if the query of the data in the studium endpoints returns an array otherwise return empty array to avoid breaking the endpoint

This commit is contained in:
SimonGschnell
2025-07-07 10:10:38 +02:00
parent d48865d2a1
commit 5280943099
@@ -313,10 +313,12 @@ SELECT tbl_lehrveranstaltung.*,
private function computeLektorenFromLehrveranstaltung($lehreinheit_id, $semester, $studiengang, $studiensemester){
$this->load->library('StundenplanLib');
$lektoren = $this->stundenplanlib->getLektorenFromLehrveranstaltung($lehreinheit_id,$semester, $studiengang,$studiensemester);
$lektoren = $this->getDataOrTerminateWithError($lektoren);
$lektoren = $this->getDataOrTerminateWithError($lektoren) ?? [];
$lektoren = array_map(function($lektor){
return ["name"=>$this->getDataOrTerminateWithError($this->PersonModel->getFullName($lektor)), "email"=>$lektor."@".DOMAIN];
},$lektoren);
return $lektoren;
}