Преглед на файлове

fix crash when bonus limiter is empty in OwnerUpdater

kdmcser преди 7 месеца
родител
ревизия
a17f59b704
променени са 1 файла, в които са добавени 2 реда и са изтрити 1 реда
  1. 2 1
      lib/bonuses/Updaters.cpp

+ 2 - 1
lib/bonuses/Updaters.cpp

@@ -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;
 }