Browse Source

Verify that the data property exists first

Abdullah Almsaeed 6 years ago
parent
commit
6d247154b5
1 changed files with 4 additions and 1 deletions
  1. 4 1
      tripal/includes/tripal.entity.inc

+ 4 - 1
tripal/includes/tripal.entity.inc

@@ -443,7 +443,10 @@ function tripal_entity_access($op, $entity = NULL, $account = NULL, $entity_type
   }
   elseif (intval($entity) !== 0) {
     if (!isset($cache)) {
-      $cache = cache_get("tripal_entity_access_cache")->data;
+      $cache = cache_get("tripal_entity_access_cache");
+      if (isset($cache->data)) {
+        $cache = $cache->data;
+      }
     }
 
     if (empty($cache)) {