Skip to content
Snippets Groups Projects

Issue #3457389: AssertionError: Cannot load the "file" entity with NULL ID

1 file
+ 4
2
Compare changes
  • Side-by-side
  • Inline
@@ -186,8 +186,10 @@ class CalendarDownloadType extends FieldItemBase {
// The current fielditem belongs to a fielditemlist,
// that in turn belongs to a fieldable entity.
$entity = $this->getParent()->getParent()->getValue();
$file = File::load($this->get('fileref')->getValue());
$this->fileUsageService->delete($file, 'ics_field', $entity->getEntityTypeId(), $entity->id());
if ($entity && $this->get('fileref')->getValue()) {
$file = File::load($this->get('fileref')->getValue());
$this->fileUsageService->delete($file, 'ics_field', $entity->getEntityTypeId(), $entity->id());
}
}
/**
Loading