1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-07-15 01:24:45 +02:00

fix crash when bonus limiter is empty in OwnerUpdater

This commit is contained in:
kdmcser
2025-04-26 02:15:25 +08:00
parent 975d9aedc9
commit a17f59b704

View File

@ -229,7 +229,8 @@ std::shared_ptr<Bonus> OwnerUpdater::createUpdatedBonus(const std::shared_ptr<Bo
std::shared_ptr<Bonus> updated =
std::make_shared<Bonus>(*b);
updated->limiter = b->limiter;
updated->limiter->acceptUpdater(*this);
if (updated->limiter)
updated->limiter->acceptUpdater(*this);
return updated;
}