Skip to content

Commit

Permalink
Fixed possible assertion failure on startup
Browse files Browse the repository at this point in the history
Closes #3762
  • Loading branch information
bjorn committed Jun 6, 2023
1 parent affd736 commit 7322755
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/tiled/objectsview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,9 @@ void ObjectsView::restoreExpandedLayers()
const auto &layers = mMapDocument->expandedObjectLayers;
for (const int layerId : layers) {
if (Layer *layer = mMapDocument->map()->findLayerById(layerId)) {
if (!layer->isObjectGroup() && !layer->isGroupLayer())
continue;

const QModelIndex sourceIndex = mMapDocument->mapObjectModel()->index(layer);
const QModelIndex index = mProxyModel->mapFromSource(sourceIndex);
setExpanded(index, true);
Expand Down

0 comments on commit 7322755

Please sign in to comment.