From 468b605c823f0015c38a3f4768216bf3eee557ef Mon Sep 17 00:00:00 2001 From: renzuzu <82306584+renzuzu@users.noreply.github.com> Date: Tue, 31 Aug 2021 14:16:14 +0800 Subject: [PATCH] tweak(js): prevent element error --- renzu_hud/ui/js/demo.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/renzu_hud/ui/js/demo.js b/renzu_hud/ui/js/demo.js index 715c5ce8..aec52c68 100644 --- a/renzu_hud/ui/js/demo.js +++ b/renzu_hud/ui/js/demo.js @@ -278,7 +278,7 @@ function setStatus(t) { document.getElementById(table[i].status+'blink').style.color = "rgba(151, 147, 147, 0.623)"; document.getElementById(table[i].status+'blink').style.setProperty("-webkit-filter", "drop-shadow(15px -1px 22px rgba(255, 5, 5, 0.0)"); } - if (setting['status'] && setting['status'][table[i].status].hideifmax && setting['status'][table[i].status].type == 1) { + if (setting['status'] && setting['status'][table[i].status].hideifmax && setting['status'][table[i].status].type == 1 && document.getElementById(table[i].status+'div')) { if(table[i].min_val_hide == undefined) { table[i].min_val_hide = 100 } if (table[i].value >= setting['status'][table[i].status].min_val_hide && table[i].status !== 'armor' && table[i].status !== 'stress' && table[i].type == 1 || table[i].value <= setting['status'][table[i].status].min_val_hide && table[i].status !== 'armor' && table[i].status == 'stress' && table[i].type == 1) { document.getElementById(table[i].status+'div').style.display = 'none'