From 0962188447dfd777514325ad6d3c335e845bfad1 Mon Sep 17 00:00:00 2001
From: [Freshbyte] Laurentiu Lese <laurentiu.lese@freshbyte.ro>
Date: Mon, 12 Mar 2012 15:37:00 +0200
Subject: [PATCH] Trying to get property of non-object in
 entity_metadata_user_access fix.

---
 .../modules/contrib/entity/modules/callbacks.inc   |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/www/sites/all/modules/contrib/entity/modules/callbacks.inc b/www/sites/all/modules/contrib/entity/modules/callbacks.inc
index 11e07bf..c6cca5f 100644
--- a/www/sites/all/modules/contrib/entity/modules/callbacks.inc
+++ b/www/sites/all/modules/contrib/entity/modules/callbacks.inc
@@ -544,7 +544,7 @@ function entity_metadata_no_hook_node_access($op, $node = NULL, $account = NULL)
 function entity_metadata_user_access($op, $entity = NULL, $account = NULL, $entity_type) {
   $account = isset($account) ? $account : $GLOBALS['user'];
   // Grant access to the users own user account and to the anonymous one.
-  if (isset($entity) && $op != 'delete' && (($entity->uid == $account->uid && $entity->uid) || (!$entity->uid && $op == 'view'))) {
+  if (is_object($entity) && $op != 'delete' && (($entity->uid == $account->uid && $entity->uid) || (!$entity->uid && $op == 'view'))) {
     return TRUE;
   }
   if (user_access('administer users', $account) || user_access('access user profiles', $account) && $op == 'view') {
-- 
1.7.5.1

