mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-02-04 03:40:14 +00:00
Check if options arguments are a table
This commit is contained in:
parent
9b27973479
commit
26154c85a1
@ -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…
x
Reference in New Issue
Block a user