From 4cc83f321460597318427f0959d38eaa36d44ed5 Mon Sep 17 00:00:00 2001
From: Darren Oh <darren@oh.name>
Date: Wed, 26 Oct 2016 11:15:09 -0400
Subject: [PATCH] Issue #1390708 by milesw, jamsilver, Darren Oh: Fixed crash
 with reference to missing entity.

---
 uuid.entity.inc | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/uuid.entity.inc b/uuid.entity.inc
index 4306339..9e6ff02 100644
--- a/uuid.entity.inc
+++ b/uuid.entity.inc
@@ -629,6 +629,13 @@ function entity_property_uuid_to_id(&$objects, $entity_type, $properties) {
     if (isset($ids[$value])) {
       $values[$i] = $ids[$value];
     }
+    // The UUID lookup failed, remove the item.
+    elseif (is_array($objects)) {
+      unset($objects[$i]);
+    }
+    else {
+      $objects = NULL;
+    }
   }
 }
 
-- 
2.8.4 (Apple Git-73)

