mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-01-06 11:39:49 -06:00
Prevent crash when moving a layer to the top of a list that only has two entries (closes #3414)
This commit is contained in:
@@ -221,7 +221,7 @@ void LayerGroup::moveLayer(int oldPosition, int newPosition) {
|
||||
ghoul_assert(!_layers.empty(), "The list should not be empty at this point");
|
||||
if (newLayerPos == _layers.begin()) {
|
||||
// If the layer is moved to the first spot in the list
|
||||
Layer* nextLayer = (_layers.begin() + 1)->get();
|
||||
Layer* nextLayer = _layers.begin()->get();
|
||||
layer->setZIndex(nextLayer->zIndex());
|
||||
}
|
||||
else if (newLayerPos == _layers.end()) {
|
||||
|
||||
Reference in New Issue
Block a user