Browse Source

Fix key not found error

mboudet 6 năm trước cách đây
mục cha
commit
9f0da0bbd9
1 tập tin đã thay đổi với 4 bổ sung1 xóa
  1. 4 1
      tripal/includes/TripalFieldQuery.inc

+ 4 - 1
tripal/includes/TripalFieldQuery.inc

@@ -124,7 +124,10 @@ class TripalFieldQuery extends EntityFieldQuery {
       if (is_numeric($results)) {
         return $results;
       }
-      return count($results['TripalEntity']);
+      if (array_key_exists('TripalEntity', $results)) {
+        return count($results['TripalEntity']);
+      }
+      return 0;
     }
     return $results;
   }