Skip to content

Commit

Permalink
Don't accidentally load defaults
Browse files Browse the repository at this point in the history
  • Loading branch information
p3lim committed Jul 24, 2024
1 parent d0a02c0 commit 9a26d29
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion modules/settings/savedvariables.lua
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,11 @@ function addon:GetOption(key)
assert(self:AreOptionsLoaded(), "options aren't loaded")
addon:ArgCheck(key, 1, 'string')

return _G[self.optionsName][key] ~= nil and _G[self.optionsName][key] or self.optionsDefaults[key]
if _G[self.optionsName][key] ~= nil then
return _G[self.optionsName][key]
else
return self.optionsDefaults[key]
end
end

--[[ namespace:GetOptionDefault(_key_)
Expand Down

0 comments on commit 9a26d29

Please sign in to comment.