`if (null === $entity || !$entity->getData())` ?