diff options
author | Brett Profitt <brett.profitt@gmail.com> | 2011-04-16 11:52:37 -0400 |
---|---|---|
committer | Brett Profitt <brett.profitt@gmail.com> | 2011-04-16 11:52:37 -0400 |
commit | 309dff2bf948ab191ccb1e8d4a777e49ad498820 (patch) | |
tree | 813350181be64e239287c0bb587a3a49320a49b7 /engine/classes/ElggUser.php | |
parent | 119ec1f1425ab77ed29c696d99c0c80df3886791 (diff) | |
parent | 2b2afd98c05139c1a5c25f1752e2bb412e26e335 (diff) | |
download | elgg-309dff2bf948ab191ccb1e8d4a777e49ad498820.tar.gz elgg-309dff2bf948ab191ccb1e8d4a777e49ad498820.tar.bz2 |
Merge branch 'master' of github.com:Elgg/Elgg
Diffstat (limited to 'engine/classes/ElggUser.php')
-rw-r--r-- | engine/classes/ElggUser.php | 8 |
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 |