Fix crash due to null mCardCounters (#5984)

This commit is contained in:
RickyRister 2025-06-13 05:48:39 -07:00 committed by GitHub
parent 39df168891
commit 30730fe632
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -849,6 +849,8 @@ void Player::retranslateUi()
aCreateAnotherToken->setText(tr("C&reate another token"));
createPredefinedTokenMenu->setTitle(tr("Cr&eate predefined token"));
mCardCounters->setTitle(tr("Ca&rd counters"));
QMapIterator<int, AbstractCounter *> counterIterator(counters);
while (counterIterator.hasNext()) {
counterIterator.next().value()->retranslateUi();
@ -898,7 +900,6 @@ void Player::retranslateUi()
auto &cardCounterSettings = SettingsCache::instance().cardCounters();
mCardCounters->setTitle(tr("Ca&rd counters"));
for (int i = 0; i < aAddCounter.size(); ++i) {
aAddCounter[i]->setText(tr("&Add counter (%1)").arg(cardCounterSettings.displayName(i)));
}