Null guard for clicking post area while loading

This commit is contained in:
SENOO, Ken 2022-10-15 18:08:42 +09:00
parent fcbf2c0c2b
commit be7029942d

View File

@ -3213,6 +3213,10 @@ $('body').on('keyup paste input', 'div.queet-box-syntax', function() {
currentVal = currentVal.replace(/<br>$/, '').replace(/&nbsp;$/, '').replace(/ $/, ''); // fix
$(this).siblings('.syntax-two').html(currentVal);
// If user click post area before load finished (top gnu logo), this is undefined.
if (!window.syntaxHighlightingRegexps) {
window.syntaxHighlightingRegexps = Object();
}
// loop through the regexps and highlight
$.each(window.syntaxHighlightingRegexps,function(k,v){