diff options
author | Brett Profitt <brett.profitt@gmail.com> | 2011-10-04 20:01:53 -0700 |
---|---|---|
committer | Brett Profitt <brett.profitt@gmail.com> | 2011-10-04 20:01:53 -0700 |
commit | 34a7e57ef205362d6c093fa7234ca38977560bea (patch) | |
tree | 0737fa2f6c25a4f2639a0a4050a11d6d61f1bb3a /pages | |
parent | 0f7ae214b37c2bcf6f7c0af82ec68b7c9224cfaf (diff) | |
download | elgg-34a7e57ef205362d6c093fa7234ca38977560bea.tar.gz elgg-34a7e57ef205362d6c093fa7234ca38977560bea.tar.bz2 |
Refs #3396. Added try / catch for avatar icon.
Diffstat (limited to 'pages')
-rw-r--r-- | pages/avatar/view.php | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/pages/avatar/view.php b/pages/avatar/view.php index da22ad849..904a57610 100644 --- a/pages/avatar/view.php +++ b/pages/avatar/view.php @@ -24,12 +24,18 @@ $filehandler->owner_guid = $user->getGUID(); $filehandler->setFilename("profile/" . $user->getGUID() . $size . ".jpg"); $success = false; -if ($filehandler->open("read")) { - if ($contents = $filehandler->read($filehandler->size())) { - $success = true; + +try { + if ($filehandler->open("read")) { + if ($contents = $filehandler->read($filehandler->size())) { + $success = true; + } } +} catch (InvalidParameterException $e) { + elgg_log("Unable to get profile icon for user with GUID $entity->guid", 'ERROR'); } + if (!$success) { $url = "_graphics/icons/user/default{$size}.gif"; $url = elgg_normalize_url($url); |