mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-06-01 20:29:29 +00:00
fix api endpoint http error 500 when stundenplan_events is null or empty array
This commit is contained in:
@@ -81,7 +81,14 @@ class Stundenplan extends FHCAPI_Controller
|
||||
$lv_id = $this->input->get('lv_id', TRUE);
|
||||
|
||||
$stundenplan_events = $this->stundenplanlib->getStundenplan($start_date,$end_date,$lv_id);
|
||||
$stundenplan_events = $this->getDataOrTerminateWithError($stundenplan_events);
|
||||
if( is_null($stundenplan_events) || isEmptyArray($stundenplan_events) )
|
||||
{
|
||||
$stundenplan_events = array();
|
||||
}
|
||||
else
|
||||
{
|
||||
$stundenplan_events = $this->getDataOrTerminateWithError($stundenplan_events);
|
||||
}
|
||||
|
||||
// fetching moodle events
|
||||
$moodle_start_date = new DateTime($start_date);
|
||||
|
||||
Reference in New Issue
Block a user