Verify that PrefsTable[name] exists before indexing the pref.

This commit is contained in:
teejusb
2021-09-24 14:49:02 -07:00
parent 5d4a6cf903
commit 569b1dba33
+7 -4
View File
@@ -62,11 +62,14 @@ end
local function ResolveTable( pref ) local function ResolveTable( pref )
-- check the section for this theme -- check the section for this theme
local name = GetThemeName() local name = GetThemeName()
local val = PrefsTable[name][pref] local val = nil
if val ~= nil then if PrefsTable[name] then
--Trace( ("ResolveTable(%s): found in %s"):format(pref,name) ) val = PrefsTable[name][pref]
return PrefsTable[name] if val ~= nil then
--Trace( ("ResolveTable(%s): found in %s"):format(pref,name) )
return PrefsTable[name]
end
end end
-- not in the current theme; check the fallback if it exists -- not in the current theme; check the fallback if it exists