diff --git a/core/classes/Avatar.class.php b/core/classes/Avatar.class.php index aa35518922..a7a088c3fb 100644 --- a/core/classes/Avatar.class.php +++ b/core/classes/Avatar.class.php @@ -65,15 +65,15 @@ public static function get( $p_user_id, $p_size = 80 ) { $t_avatar = event_signal( 'EVENT_USER_AVATAR', array( $p_user_id, $p_size ) ); - } - if( $t_avatar === null ) { - $t_avatar = new Avatar(); - } + if( $t_avatar === null ) { + $t_avatar = new Avatar(); + } - $t_avatar->normalize( $p_user_id ); + $t_avatar->normalize( $p_user_id ); + } - return $t_avatar; + return $t_avatar; } /** diff --git a/core/classes/TimelineEvent.class.php b/core/classes/TimelineEvent.class.php index 374d20f83d..0db5577b72 100644 --- a/core/classes/TimelineEvent.class.php +++ b/core/classes/TimelineEvent.class.php @@ -73,6 +73,10 @@ public function format_timestamp( $p_timestamp ) { */ public function html_start() { $t_avatar = Avatar::get( $this->user_id, 32 ); + if( $t_avatar === null ) { + return sprintf( + '
%s
', $this->format_timestamp( $this->timestamp ) ); + } return sprintf( '
%s
%s
', diff --git a/core/print_api.php b/core/print_api.php index b4c4cf08a4..b12d70ef8a 100644 --- a/core/print_api.php +++ b/core/print_api.php @@ -187,6 +187,9 @@ function print_successful_redirect( $p_redirect_to ) { */ function print_avatar( $p_user_id, $p_size = 80 ) { $t_avatar = Avatar::get( $p_user_id, $p_size ); + if( $t_avatar === null ) { + return; + } $t_image = htmlspecialchars( $t_avatar->image ); $t_link = htmlspecialchars( $t_avatar->link );