mirror of
https://github.com/aseprite/aseprite.git
synced 2024-10-04 13:59:46 +00:00
Fix crash if the last layer index saved in the doc preferences is out of bounds
This commit is contained in:
parent
36719da7b2
commit
eb43fa93bd
@ -193,7 +193,7 @@ Editor::Editor(Document* document, EditorFlags flags)
|
|||||||
|
|
||||||
LayerList layers = m_sprite->allBrowsableLayers();
|
LayerList layers = m_sprite->allBrowsableLayers();
|
||||||
layer_t layerIndex = m_docPref.site.layer();
|
layer_t layerIndex = m_docPref.site.layer();
|
||||||
if (layerIndex >= 0 && layerIndex <= int(layers.size()))
|
if (layerIndex >= 0 && layerIndex < int(layers.size()))
|
||||||
setLayer(layers[layerIndex]);
|
setLayer(layers[layerIndex]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user