diff --git a/app/model/Event/Factory/EducationFactory.php b/app/model/Event/Factory/EducationFactory.php index 8edc7c6b8..64afa271e 100644 --- a/app/model/Event/Factory/EducationFactory.php +++ b/app/model/Event/Factory/EducationFactory.php @@ -36,7 +36,9 @@ public function create(stdClass $skautisEducation): Education $skautisEducation->EndDate === null ? null : Date::createFromFormat(self::DATETIME_FORMAT, $skautisEducation->EndDate), $skautisEducation->Location ?? '', $skautisEducation->ID_EventEducationState ?? '', - $skautisEducation->ID_Grant !== null ? new SkautisGrantId($skautisEducation->ID_Grant) : null, + property_exists($skautisEducation, 'ID_Grant') && $skautisEducation->ID_Grant !== null + ? new SkautisGrantId($skautisEducation->ID_Grant) + : null, ); } }