gluon-web: ListValue: convert keys to strings before adding to key list
Fixes validation of ListValues.
Fixes: ec532b95
"gluon-web: extend ListValue with optional and unset
values"
This commit is contained in:
parent
273a60fe62
commit
9ece0daa76
@ -401,14 +401,16 @@ function ListValue:__init__(...)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function ListValue:value(key, val, ...)
|
function ListValue:value(key, val, ...)
|
||||||
|
key = tostring(key)
|
||||||
|
|
||||||
if self.keys[key] then
|
if self.keys[key] then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
self.keys[key] = true
|
||||||
|
|
||||||
val = val or key
|
val = val or key
|
||||||
self.keys[key] = true
|
|
||||||
table.insert(self.entry_list, {
|
table.insert(self.entry_list, {
|
||||||
key = tostring(key),
|
key = key,
|
||||||
value = tostring(val),
|
value = tostring(val),
|
||||||
deps = {...},
|
deps = {...},
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user