diff options
author | brettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-10-10 19:00:20 +0000 |
---|---|---|
committer | brettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-10-10 19:00:20 +0000 |
commit | 19bf7926bab6e5280c45fb9d3039d038bdfaf383 (patch) | |
tree | 82758162f219569719d17031cf5e59852569195e /engine/lib/entities.php | |
parent | bd011bb478a9a346db70b79576e205e19dfe1875 (diff) | |
download | elgg-19bf7926bab6e5280c45fb9d3039d038bdfaf383.tar.gz elgg-19bf7926bab6e5280c45fb9d3039d038bdfaf383.tar.bz2 |
Checking for a valid entity before using its methods in update_entity().
git-svn-id: http://code.elgg.org/elgg/trunk@7049 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/lib/entities.php')
-rw-r--r-- | engine/lib/entities.php | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/engine/lib/entities.php b/engine/lib/entities.php index e35252619..534b61e19 100644 --- a/engine/lib/entities.php +++ b/engine/lib/entities.php @@ -376,7 +376,7 @@ function update_entity($guid, $owner_guid, $access_id, $container_guid = null) { $entity = get_entity($guid); - if ($entity->canEdit()) { + if ($entity && $entity->canEdit()) { if (trigger_elgg_event('update', $entity->type, $entity)) { $ret = update_data("UPDATE {$CONFIG->dbprefix}entities set owner_guid='$owner_guid', access_id='$access_id', container_guid='$container_guid', time_updated='$time' WHERE guid=$guid"); |