mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-10-21 20:21:38 +00:00
Handle nil APIs
This commit is contained in:
parent
9d412a3273
commit
5cf9a7de42
1 changed files with 5 additions and 2 deletions
|
|
@ -40,7 +40,10 @@ function API.new(app)
|
|||
Rojo._apiDescriptions.ProjectName = "The name of the project that the plugin is connected to"
|
||||
|
||||
Rojo.Version = table.clone(Config.version)
|
||||
Rojo._apiDescriptions.Version = "The version of the plugin"
|
||||
|
||||
Rojo.ProtocolVersion = Config.protocolVersion
|
||||
Rojo._apiDescriptions.ProtocolVersion = "The protocol version that the plugin is using"
|
||||
|
||||
function Rojo:_updateProperty(property: string, value: any?)
|
||||
local oldValue = Rojo[property]
|
||||
|
|
@ -201,7 +204,7 @@ function API.new(app)
|
|||
-- Sanitize request
|
||||
local sanitizedApis = {}
|
||||
for _, api in apis do
|
||||
if Rojo[api] ~= nil then
|
||||
if Rojo._apiDescriptions[api] ~= nil then
|
||||
table.insert(sanitizedApis, api)
|
||||
else
|
||||
warn(string.format("Rojo.%s is not a valid API", tostring(api)))
|
||||
|
|
@ -330,7 +333,7 @@ function API.new(app)
|
|||
end
|
||||
|
||||
-- Existence check
|
||||
if Rojo[key] == nil then
|
||||
if Rojo._apiDescriptions[key] == nil then
|
||||
warn(string.format("Rojo.%s is not a valid API", tostring(key)))
|
||||
return nil
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue