From 30772ec720dfcf24eff84b4d8c42ddedb39514a9 Mon Sep 17 00:00:00 2001 From: Adhityaa Chandrasekar Date: Sat, 20 Apr 2019 21:05:23 -0400 Subject: [PATCH] commento.js: do not set href if link is undefined Fixes https://gitlab.com/commento/commento/issues/156 --- frontend/js/commento.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/frontend/js/commento.js b/frontend/js/commento.js index 48379e4..68efed6 100644 --- a/frontend/js/commento.js +++ b/frontend/js/commento.js @@ -237,7 +237,12 @@ var loggedContainer = create("div"); var loggedInAs = create("div"); - var name = create("a"); + var name; + if (commenter.link !== "undefined") { + name = create("a"); + } else { + name = create("div"); + } var avatar; var logout = create("div"); var color = colorGet(commenter.commenterHex + "-" + commenter.name); @@ -255,7 +260,9 @@ onclick(logout, global.logout); attrSet(loggedContainer, "style", "display: none"); - attrSet(name, "href", commenter.link); + if (commenter.link !== "undefined") { + attrSet(name, "href", commenter.link); + } if (commenter.photo === "undefined") { avatar = create("div"); avatar.style["background"] = color;