check for null zone during card item teardown

Took 1 hour 32 minutes


Took 24 seconds
This commit is contained in:
Lukas Brübach 2025-09-15 18:48:08 +02:00
parent aff775f488
commit 184901c19c

View file

@ -191,7 +191,13 @@ void CardItem::setAttachedTo(CardItem *_attachedTo)
attachedTo->getZone()->reorganizeCards();
}
} else {
emit zone->cardAdded(this);
// If the zone is being torn down, it might already be null by the time a card tries to re-attach all its
// attached cards
if (zone == nullptr) {
deleteLater();
} else {
emit zone->cardAdded(this);
}
}
if (zone != nullptr) {