mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-10-22 21:41:37 +00:00
Validate settings type before passing them to set
This commit is contained in:
parent
e459ae920f
commit
b98af57ec5
1 changed files with 1 additions and 0 deletions
|
|
@ -350,6 +350,7 @@ function API.new(app)
|
||||||
Rojo._apiDescriptions.SetSetting = "Sets a Rojo setting"
|
Rojo._apiDescriptions.SetSetting = "Sets a Rojo setting"
|
||||||
function Rojo:SetSetting(setting: string, value: any)
|
function Rojo:SetSetting(setting: string, value: any)
|
||||||
assert(type(setting) == "string", "Setting must be type `string`")
|
assert(type(setting) == "string", "Setting must be type `string`")
|
||||||
|
assert(type(value) == type(Settings:get(setting)), "Value must be the same type as the setting")
|
||||||
|
|
||||||
if Rojo:_checkRateLimit("SetSetting") then
|
if Rojo:_checkRateLimit("SetSetting") then
|
||||||
return
|
return
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue