diff --git a/modules/entity/entity.module b/modules/entity/entity.module index 37bc5b3..09c4c2c 100644 --- a/modules/entity/entity.module +++ b/modules/entity/entity.module @@ -256,8 +256,9 @@ function entity_load($entity_type, $ids = FALSE, $conditions = array(), $reset = function entity_load_unchanged($entity_type, $id) { entity_get_controller($entity_type)->resetCache(array($id)); $result = entity_get_controller($entity_type)->load(array($id)); - $entity = reset($result); - $entity->entity_type = $entity_type; + if ($entity = reset($result)) { + $entity->entity_type = $entity_type; + } return $entity; }