diff --git a/EntityDependencyIterator.inc b/EntityDependencyIterator.inc
index 9ae6272..5d590a3 100644
--- a/EntityDependencyIterator.inc
+++ b/EntityDependencyIterator.inc
@@ -114,6 +114,9 @@ class EntityDependencyIterator implements RecursiveIterator {
       // Load the current entity.
       $entities = entity_load($current['type'], array($current['id']));
       $entity = reset($entities);
+      if (empty($entity)) {
+        return FALSE;
+      }
 
       $this->dependencies = module_invoke_all('entity_dependencies', $entity, $current['type']);
       //$this->belongings = module_invoke_all('entity_belongings', $entity, $this->entityType);
