Skip to content

Commit

Permalink
Fixed crash when closing last document with properties selected
Browse files Browse the repository at this point in the history
When there is more than one custom property selected when closing the
last document, a crash would occur due to a null pointer dereference
while updating the actions on the Properties view tool bar.
  • Loading branch information
bjorn committed Jan 28, 2025
1 parent 150d9a8 commit 5936246
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
### Unreleased

* Fixed potential crash when handling file reloads
* Fixed crash while handling file reloads without any files opened
* Fixed crash when closing the last file with multiple custom properties selected

### Tiled 1.11.1 (11 Jan 2025)

Expand Down
2 changes: 1 addition & 1 deletion src/tiled/propertieswidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ void PropertiesWidget::updateActions()
bool allCustomProperties = !items.isEmpty() && mPropertyBrowser->allCustomPropertyItems(items);
bool editingTileset = mDocument && mDocument->type() == Document::TilesetDocumentType;
bool isTileset = mPropertyBrowser->object() && mPropertyBrowser->object()->isPartOfTileset();
bool canModify = allCustomProperties && (!isTileset || editingTileset);
bool canModify = mDocument && allCustomProperties && (!isTileset || editingTileset);

// Disable remove and rename actions when none of the selected objects
// actually have the selected property (it may be inherited).
Expand Down

0 comments on commit 5936246

Please sign in to comment.