Load each module and skin through securecallfunction so one error no longer stops the rest from loading

This commit is contained in:
Brues
2026-10-31 21:17:42 -05:00
parent 5476a28982
commit b2cffcb3c2
+4 -2
View File
@@ -345,14 +345,16 @@ function pfUI:RegisterSkin(name, func, arg3)
end
end
-- an error in one module or skin goes to the error handler without
-- stopping the ones that load after it
function pfUI:LoadModule(m)
setfenv(pfUI.module[m], pfUI:GetEnvironment())
pfUI.module[m]()
securecallfunction(pfUI.module[m])
end
function pfUI:LoadSkin(s)
setfenv(pfUI.skin[s], pfUI:GetEnvironment())
pfUI.skin[s]()
securecallfunction(pfUI.skin[s])
end
pfUI:SetScript("OnEvent", function()