aboutsummaryrefslogtreecommitdiff
path: root/pages
diff options
context:
space:
mode:
Diffstat (limited to 'pages')
-rw-r--r--pages/avatar/view.php14
1 files changed, 10 insertions, 4 deletions
diff --git a/pages/avatar/view.php b/pages/avatar/view.php
index eb2cd1010..904a57610 100644
--- a/pages/avatar/view.php
+++ b/pages/avatar/view.php
@@ -24,14 +24,20 @@ $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}";
+ $url = "_graphics/icons/user/default{$size}.gif";
$url = elgg_normalize_url($url);
forward($url);
}