mirror of
https://github.com/centau/vide.git
synced 2026-08-20 23:01:37 +00:00
Add error handling for no properties specified
This commit is contained in:
parent
835f4d429b
commit
8b4210e66a
1 changed files with 4 additions and 0 deletions
|
|
@ -118,6 +118,10 @@ end
|
|||
|
||||
-- applies table of nested properties to an instance using full vide semantics
|
||||
local function apply<T>(instance: T & Instance, properties: { [unknown]: unknown }): T
|
||||
if not properties then
|
||||
throw("no properties given, did you forget to call the constructor returned by create()?")
|
||||
end
|
||||
|
||||
-- queue parent assignment if any for last
|
||||
local parent: unknown = properties.Parent
|
||||
if parent then properties.Parent = nil end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue