From 3035a5713d99121a2eb096032341b8177edf6387 Mon Sep 17 00:00:00 2001 From: Gaspar Capello Date: Fri, 15 Jan 2021 16:40:48 -0300 Subject: [PATCH] Fix crash deleting a group layer at the top level The crash could be achieved by having just one group layer at the top level (with some children) and trying to delete it using Layer > Delete Layer menu option (without using the timeline range). Report: https://igarastudio.zendesk.com/agent/tickets/1719 --- src/app/commands/cmd_remove_layer.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/commands/cmd_remove_layer.cpp b/src/app/commands/cmd_remove_layer.cpp index a36d6532f..0ee577521 100644 --- a/src/app/commands/cmd_remove_layer.cpp +++ b/src/app/commands/cmd_remove_layer.cpp @@ -1,5 +1,5 @@ // Aseprite -// Copyright (C) 2020 Igara Studio S.A. +// Copyright (C) 2020-2021 Igara Studio S.A. // Copyright (C) 2001-2018 David Capello // // This program is distributed under the terms of @@ -78,7 +78,7 @@ void RemoveLayerCommand::onExecute(Context* context) } } else { - if (sprite->allLayersCount() == 1) { + if (sprite->root()->layersCount() == 1) { ui::Alert::show(Strings::alerts_cannot_delete_all_layers()); return; }