aboutsummaryrefslogtreecommitdiff
path: root/pages
diff options
context:
space:
mode:
authorBrett Profitt <brett.profitt@gmail.com>2011-10-04 20:01:53 -0700
committerBrett Profitt <brett.profitt@gmail.com>2011-10-04 20:01:53 -0700
commit34a7e57ef205362d6c093fa7234ca38977560bea (patch)
tree0737fa2f6c25a4f2639a0a4050a11d6d61f1bb3a /pages
parent0f7ae214b37c2bcf6f7c0af82ec68b7c9224cfaf (diff)
downloadelgg-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.php12
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);