Skip to content

Instantly share code, notes, and snippets.

@Berdir
Created September 27, 2013 07:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Berdir/34299ecb260af6fec2e4 to your computer and use it in GitHub Desktop.
Save Berdir/34299ecb260af6fec2e4 to your computer and use it in GitHub Desktop.
@@ -219,7 +219,9 @@ public function delete() {
$entity = $this->getRoot();
// Delete all file usages within this entity.
- file_usage()->delete($this->entity, 'file', $entity->entityType(), $entity->id(), 0);
+ if ($this->entity) {
+ file_usage()->delete($this->entity, 'file', $entity->entityType(), $entity->id(), 0);
+ }
}
/**
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment