mirror of
https://github.com/aseprite/aseprite.git
synced 2025-03-29 01:20:17 +00:00
[lua] Fail if we give an invalid parent to layer.parent setter
This commit is contained in:
parent
3a82e64c23
commit
896387635b
@ -327,6 +327,8 @@ int Layer_set_parent(lua_State* L)
|
||||
else if (auto parentLayer = may_get_docobj<Layer>(L, 2)) {
|
||||
if (parentLayer->isGroup())
|
||||
parent = static_cast<LayerGroup*>(parentLayer);
|
||||
else
|
||||
return luaL_error(L, "the given parent is not a layer group or sprite");
|
||||
}
|
||||
|
||||
if (parent == layer)
|
||||
|
Loading…
x
Reference in New Issue
Block a user