diff --git a/public/js/snippetedit.js b/public/js/snippetedit.js index 4d4e9d4d..8716b528 100644 --- a/public/js/snippetedit.js +++ b/public/js/snippetedit.js @@ -24,8 +24,13 @@ function makeSnippetEdit(ownerName, ownerAvatar, ownerUrl, date, text, attachmen let attachmentChanged = false; let hasAttachment = false; snippetEdit.redirect.value = location.href; - snippetEdit.avatarImg.src = ownerAvatar; - snippetEdit.avatarLink.href = ownerUrl; + if (ownerAvatar) { + snippetEdit.avatarImg.src = ownerAvatar; + snippetEdit.avatarLink.href = ownerUrl; + snippetEdit.avatarImg.hidden = false; + } else { + snippetEdit.avatarImg.hidden = true; + } snippetEdit.username.textContent = ownerName; snippetEdit.username.href = ownerUrl; snippetEdit.date.textContent = new Intl.DateTimeFormat([], { month: "2-digit", day: "2-digit", year: "numeric" }).format(date); diff --git a/src/templates/src/include/snippet_edit.html b/src/templates/src/include/snippet_edit.html index f53d1a3e..229c9a91 100644 --- a/src/templates/src/include/snippet_edit.html +++ b/src/templates/src/include/snippet_edit.html @@ -9,7 +9,7 @@