Fix ZoneType choice_filter

This commit is contained in:
Kamil Kokot 2021-01-13 12:16:51 +01:00
parent ca218e6886
commit ac2d41aa68

View file

@ -72,8 +72,8 @@ final class ZoneType extends AbstractResourceType
];
if ($zone->getType() === ZoneInterface::TYPE_ZONE) {
$entryOptions['entry_options']['choice_filter'] = function (ZoneInterface $subZone) use ($zone): bool {
return $zone->getId() !== $subZone->getId();
$entryOptions['entry_options']['choice_filter'] = static function (?ZoneInterface $subZone) use ($zone): bool {
return $subZone !== null && $zone->getId() !== $subZone->getId();
};
}