From 6a1706f5b693e1ef499814593e4ed96301acbb67 Mon Sep 17 00:00:00 2001 From: ccd0 Date: Sat, 24 May 2014 01:15:21 -0700 Subject: [PATCH] check that jsMath and jsMath.Autoload exist --- src/Miscellaneous/Fourchan.coffee | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Miscellaneous/Fourchan.coffee b/src/Miscellaneous/Fourchan.coffee index f0309359b..7d36e8b93 100755 --- a/src/Miscellaneous/Fourchan.coffee +++ b/src/Miscellaneous/Fourchan.coffee @@ -18,10 +18,11 @@ Fourchan = # https://github.com/MayhemYDG/4chan-x/issues/645#issuecomment-13704562 $.globalEval ''' window.addEventListener('jsmath', function(e) { + if (!jsMath) return; if (jsMath.loaded) { // process one post jsMath.ProcessBeforeShowing(e.detail); - } else if (jsMath.Autoload.checked) { + } else if (jsMath.Autoload && jsMath.Autoload.checked) { // load jsMath and process whole document jsMath.Autoload.Script.Push('ProcessBeforeShowing', [null]); jsMath.Autoload.LoadJsMath();