diff --git a/eva.module b/eva.module
index 5de36e1..47d9c57 100755
--- a/eva.module
+++ b/eva.module
@@ -181,6 +181,11 @@ function eva_get_views($type = NULL, $reset = FALSE) {
  *   Either the entity object, or FALSE if it cannot be found.
  */
 function _eva_extract_entity_from_build($build, $entity_type = NULL) {
+  // #entity_type doesn't always get set
+  if(empty($build['#entity_type'])) {
+    $build['#entity_type'] = $entity_type;
+  }
+
   // EntityAPI often sticks stuff in here.
   if (!empty($build['#entity'])) {
     return $build['#entity'];
