add null checks when toggling HealBot options panels to prevent errors

This commit is contained in:
Bluewhale1337
2026-07-04 14:47:22 +02:00
parent cb1ba1ab75
commit 4c7cfbde8e
+8 -2
View File
@@ -336,10 +336,16 @@ function HealBot_Options_SetSkins()
end end
function HealBot_Options_ShowPanel(id) function HealBot_Options_ShowPanel(id)
if HealBot_Options_CurrentPanel>0 then if HealBot_Options_CurrentPanel>0 then
getglobal("HealBot_Options_Panel"..HealBot_Options_CurrentPanel):Hide(); local panel = getglobal("HealBot_Options_Panel"..HealBot_Options_CurrentPanel);
if panel then
panel:Hide();
end
end end
HealBot_Options_CurrentPanel = id; HealBot_Options_CurrentPanel = id;
if HealBot_Options_CurrentPanel>0 then if HealBot_Options_CurrentPanel>0 then
getglobal("HealBot_Options_Panel"..HealBot_Options_CurrentPanel):Show(); local panel = getglobal("HealBot_Options_Panel"..HealBot_Options_CurrentPanel);
if panel then
panel:Show();
end
end end
end end