mirror of
https://github.com/OpenMW/openmw.git
synced 2025-04-01 05:06:41 +00:00
Check if options arguments are a table
This commit is contained in:
parent
9b27973479
commit
26154c85a1
2 changed files with 9 additions and 0 deletions
|
@ -6,6 +6,9 @@ local groupSection = contextSection(groupSectionKey)
|
|||
groupSection:removeOnExit()
|
||||
|
||||
local function validateSettingOptions(options)
|
||||
if type(options) ~= 'table' then
|
||||
error('Setting options must be a table')
|
||||
end
|
||||
if type(options.key) ~= 'string' then
|
||||
error('Setting must have a key')
|
||||
end
|
||||
|
@ -24,6 +27,9 @@ local function validateSettingOptions(options)
|
|||
end
|
||||
|
||||
local function validateGroupOptions(options)
|
||||
if type(options) ~= 'table' then
|
||||
error('Group options must be a table')
|
||||
end
|
||||
if type(options.key) ~= 'string' then
|
||||
error('Group must have a key')
|
||||
end
|
||||
|
|
|
@ -249,6 +249,9 @@ storage.playerSection(common.groupSectionKey):subscribe(async:callback(function(
|
|||
end))
|
||||
|
||||
local function registerPage(options)
|
||||
if type(options) ~= 'table' then
|
||||
error('Page options must be a table')
|
||||
end
|
||||
if type(options.key) ~= 'string' then
|
||||
error('Page must have a key')
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue