mirror of
https://github.com/aseprite/aseprite.git
synced 2025-02-23 09:41:04 +00:00
[lua] Fix crash when setting layer.parent to nil
This commit is contained in:
parent
896387635b
commit
0fc4989419
@ -331,7 +331,9 @@ int Layer_set_parent(lua_State* L)
|
||||
return luaL_error(L, "the given parent is not a layer group or sprite");
|
||||
}
|
||||
|
||||
if (parent == layer)
|
||||
if (!parent)
|
||||
return luaL_error(L, "parent cannot be nil");
|
||||
else if (parent == layer)
|
||||
return luaL_error(L, "the parent of a layer cannot be the layer itself");
|
||||
|
||||
// TODO Why? should we be able to do this? It would require some hard work:
|
||||
|
Loading…
x
Reference in New Issue
Block a user