Merge pull request #2153 from teejusb/verifythemename

Verify that PrefsTable[name] exists before attempting to index the preference in ThemPrefs
This commit is contained in:
Crystal Squirrel
2021-10-01 00:23:12 +01:00
committed by GitHub
+4 -1
View File
@@ -62,12 +62,15 @@ 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 PrefsTable[name] then
val = PrefsTable[name][pref]
if val ~= nil then if val ~= nil then
--Trace( ("ResolveTable(%s): found in %s"):format(pref,name) ) --Trace( ("ResolveTable(%s): found in %s"):format(pref,name) )
return PrefsTable[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
if PrefsTable[FallbackTheme] then if PrefsTable[FallbackTheme] then