From bee067f8ec506b7da2a30569c67de77b05847ef2 Mon Sep 17 00:00:00 2001 From: Jeremy Zhang Date: Mon, 9 Oct 2017 17:56:00 +0000 Subject: [PATCH] Force global guest avatar if avatar string is null --- webapp/titanembeds/static/js/embed.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/webapp/titanembeds/static/js/embed.js b/webapp/titanembeds/static/js/embed.js index cb7b7d2..bcc975e 100644 --- a/webapp/titanembeds/static/js/embed.js +++ b/webapp/titanembeds/static/js/embed.js @@ -833,7 +833,11 @@ Mustache.parse(template); for (var i = messages.length-1; i >= 0; i--) { var message = messages[i]; - var avatar = generate_avatar_url(message.author.id, message.author.avatar, message.content); + if (message.author.avatar) { + var avatar = generate_avatar_url(message.author.id, message.author.avatar, message.content); + } else { + var avatar = global_guest_icon; + } message = replace_message_mentions(message); message = format_bot_message(message); message = parse_message_time(message);