Skip to content
Snippets Groups Projects
Commit bdd55511 authored by David Siegfried's avatar David Siegfried
Browse files

prevent php8-warnings, closes #2383

Closes #2383

Merge request studip/studip!1575
parent 99339ad5
No related branches found
No related tags found
No related merge requests found
......@@ -21,10 +21,11 @@ abstract class CoursewareController extends AuthenticatedController
{
$this->unit_id = $unit->id;
$last_element = $this->getLastElement($last, $context, $rangeId);
if ($last_element) {
$last_element_unit = $last_element->findUnit();
}
if ($last_element_unit->id === $unit->id) {
if (isset($last_element_unit) && $last_element_unit->id === $unit->id) {
$this->entry_element_id = $last_element->id;
} else {
$this->entry_element_id = $unit->structural_element_id;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment