aboutsummaryrefslogtreecommitdiff
path: root/engine
diff options
context:
space:
mode:
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-04-14 00:03:32 +0000
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-04-14 00:03:32 +0000
commit95a952861ec1d739dfde43ab6d08f466b2aacb0e (patch)
tree588955dfff88adce32529c2b3481ff3bd3f7dd2e /engine
parentd87b6ffe7312888d109428e6a939f33394549677 (diff)
downloadelgg-95a952861ec1d739dfde43ab6d08f466b2aacb0e.tar.gz
elgg-95a952861ec1d739dfde43ab6d08f466b2aacb0e.tar.bz2
Checking that get_user_by_username() returned something in ElggUser constructor to prevent notice (hellekin)
git-svn-id: http://code.elgg.org/elgg/trunk@8987 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine')
-rw-r--r--engine/classes/ElggUser.php8
1 files changed, 5 insertions, 3 deletions
diff --git a/engine/classes/ElggUser.php b/engine/classes/ElggUser.php
index 5c65a4d66..1af4cdc3a 100644
--- a/engine/classes/ElggUser.php
+++ b/engine/classes/ElggUser.php
@@ -59,9 +59,11 @@ class ElggUser extends ElggEntity
// See if this is a username
} else if (is_string($guid)) {
- $guid = get_user_by_username($guid);
- foreach ($guid->attributes as $key => $value) {
- $this->attributes[$key] = $value;
+ $user = get_user_by_username($guid);
+ if ($user) {
+ foreach ($user->attributes as $key => $value) {
+ $this->attributes[$key] = $value;
+ }
}
// Is $guid is an ElggUser? Use a copy constructor