From 026f5a46666e3f7f65819029b99443dc600ad6e3 Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Tue, 23 Nov 2021 22:54:26 +0100 Subject: [PATCH] update comment avatar when emails is empty --- src/Entity/Blog/Comment.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Entity/Blog/Comment.php b/src/Entity/Blog/Comment.php index edcbace..927bbe0 100644 --- a/src/Entity/Blog/Comment.php +++ b/src/Entity/Blog/Comment.php @@ -205,7 +205,7 @@ class Comment implements EntityInterface */ public function getAvatar(): string { - return 'https://secure.gravatar.com/avatar/'.md5($this->getEmail()).'.jpg?s=90&d=retro'; + return 'https://secure.gravatar.com/avatar/'.md5($this->getEmail() ?? 'undefined@undefined').'.jpg?s=90&d=retro'; } /**