Add error handling for no properties specified

This commit is contained in:
Aaron Smith 2023-09-20 12:11:29 +01:00
parent 835f4d429b
commit 8b4210e66a

View file

@ -118,6 +118,10 @@ end
-- applies table of nested properties to an instance using full vide semantics -- applies table of nested properties to an instance using full vide semantics
local function apply<T>(instance: T & Instance, properties: { [unknown]: unknown }): T 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 -- queue parent assignment if any for last
local parent: unknown = properties.Parent local parent: unknown = properties.Parent
if parent then properties.Parent = nil end if parent then properties.Parent = nil end