mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-01-04 01:42:42 +00:00
Fix broken check for document existence
This commit is contained in:
@@ -5,7 +5,7 @@ let div = null;
|
|||||||
|
|
||||||
function safeHTML(htmlString) {
|
function safeHTML(htmlString) {
|
||||||
// If the Document interface doesn't exist, exit
|
// If the Document interface doesn't exist, exit
|
||||||
if(!document) return null;
|
if(typeof document == 'undefined') return null;
|
||||||
// If the test document and div don't exist, create them
|
// If the test document and div don't exist, create them
|
||||||
if(!doc) doc = document.implementation.createHTMLDocument('');
|
if(!doc) doc = document.implementation.createHTMLDocument('');
|
||||||
if(!div) div = doc.createElement('div');
|
if(!div) div = doc.createElement('div');
|
||||||
|
|||||||
Reference in New Issue
Block a user