aboutsummaryrefslogtreecommitdiff
path: root/pages/avatar/view.php
diff options
context:
space:
mode:
Diffstat (limited to 'pages/avatar/view.php')
-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);