Fix crash when previewing a sprite sheet export when selecting an empty layer group located at the bottom of the layer stack in the "Layers" combo box.

This commit is contained in:
Gaspar Capello 2024-05-17 16:06:13 -03:00 committed by David Capello
parent 531b2ded75
commit dd9f1ce988

View File

@ -311,7 +311,7 @@ LayerImage* Sprite::backgroundLayer() const
Layer* Sprite::firstLayer() const
{
Layer* layer = root()->firstLayer();
while (layer->isGroup())
while (layer && layer->isGroup())
layer = static_cast<LayerGroup*>(layer)->firstLayer();
return layer;
}