mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-18 00:12:15 -07:00
check for null zone during card item teardown
Took 1 hour 32 minutes Took 24 seconds
This commit is contained in:
parent
aff775f488
commit
184901c19c
1 changed files with 7 additions and 1 deletions
|
|
@ -190,9 +190,15 @@ void CardItem::setAttachedTo(CardItem *_attachedTo)
|
||||||
if (zone != attachedTo->getZone()) {
|
if (zone != attachedTo->getZone()) {
|
||||||
attachedTo->getZone()->reorganizeCards();
|
attachedTo->getZone()->reorganizeCards();
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
// 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 {
|
} else {
|
||||||
emit zone->cardAdded(this);
|
emit zone->cardAdded(this);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (zone != nullptr) {
|
if (zone != nullptr) {
|
||||||
zone->reorganizeCards();
|
zone->reorganizeCards();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue