0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2025-12-24 16:22:44 +00:00

Fix broken check for document existence

This commit is contained in:
G.Ambatte
2024-10-29 16:50:33 +13:00
parent f1bebe3895
commit 3f8ec30f89

View File

@@ -5,7 +5,7 @@ let div = null;
function safeHTML(htmlString) {
// 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(!doc) doc = document.implementation.createHTMLDocument('');
if(!div) div = doc.createElement('div');