From 96589a2658675f4977d12b17034ae4b549801e96 Mon Sep 17 00:00:00 2001 From: Adhityaa Chandrasekar Date: Fri, 28 Dec 2018 11:59:02 -0500 Subject: [PATCH] commento.js: warn user if no div with id=commento Closes https://gitlab.com/commento/commento/issues/42 --- frontend/js/commento.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/frontend/js/commento.js b/frontend/js/commento.js index 8fe9ca4..8b54ed4 100644 --- a/frontend/js/commento.js +++ b/frontend/js/commento.js @@ -1561,6 +1561,11 @@ global.main = function(callback) { root = $(ID_ROOT); + if (root === null) { + console.log("[commento] error: no root element with ID '" + ID_ROOT + "' found"); + return; + } + classAdd(root, "root"); loginBoxCreate();