aboutsummaryrefslogtreecommitdiff
path: root/mod/profile/icon.php
diff options
context:
space:
mode:
Diffstat (limited to 'mod/profile/icon.php')
-rw-r--r--mod/profile/icon.php7
1 files changed, 7 insertions, 0 deletions
diff --git a/mod/profile/icon.php b/mod/profile/icon.php
index 463eb3db5..da7667c8b 100644
--- a/mod/profile/icon.php
+++ b/mod/profile/icon.php
@@ -20,6 +20,13 @@ $size = strtolower(get_input('size'));
if (!in_array($size,array('large','medium','small','tiny','master','topbar')))
$size = "medium";
+// If user doesn't exist, return default icon
+if (!$user) {
+ $path = elgg_view("icon/user/default/$size");
+ header("Location: $path");
+ exit;
+}
+
// Try and get the icon
$filehandler = new ElggFile();
$filehandler->owner_guid = $user->getGUID();