From ff403699902053efe72eadb10fe03a282ae18588 Mon Sep 17 00:00:00 2001 From: Feanil Patel Date: Thu, 26 Dec 2019 16:13:58 -0500 Subject: [PATCH] Don't try to typset mathjax if Hub has not loaded. In our tests there are times when Mathjax has been initialized but Hub is still undefied. In this case don't queue up typesetting. --- common/static/common/js/discussion/utils.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/static/common/js/discussion/utils.js b/common/static/common/js/discussion/utils.js index b55b87fa3e..20ee03cb90 100644 --- a/common/static/common/js/discussion/utils.js +++ b/common/static/common/js/discussion/utils.js @@ -485,7 +485,7 @@ }; DiscussionUtil.typesetMathJax = function(element) { - if (typeof MathJax !== 'undefined' && MathJax !== null) { + if (typeof MathJax !== 'undefined' && MathJax !== null && MathJax.Hub !== 'undefined') { MathJax.Hub.Queue(['Typeset', MathJax.Hub, element[0]]); } };