mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-13 19:49:51 +01:00
fixed bug that terminates chatterino
seems like durationUnits[i++] tried to access a non existing element and chatterino crashed while opening the user card. this tweek fixed it
This commit is contained in:
parent
25871bdc2f
commit
f7fa000266
|
@ -30,7 +30,6 @@
|
|||
#define TEXT_VIEWS "Views: "
|
||||
#define TEXT_CREATED "Created: "
|
||||
|
||||
|
||||
namespace {
|
||||
|
||||
const auto kBorderColor = QColor(255, 255, 255, 80);
|
||||
|
@ -563,9 +562,13 @@ UserInfoPopup::TimeoutWidget::TimeoutWidget()
|
|||
|
||||
std::vector<std::pair<QString, int>> t(8); // Timeouts.
|
||||
auto i = 0;
|
||||
|
||||
std::generate(t.begin(), t.end(), [&] {
|
||||
return std::make_pair(durationsPerUnit[i] + durationUnits[i],
|
||||
calculateTimeoutDuration(durationsPerUnit[i], durationUnits[i++]));
|
||||
std::pair<QString, int> pair = std::make_pair(
|
||||
durationsPerUnit[i] + durationUnits[i],
|
||||
calculateTimeoutDuration(durationsPerUnit[i], durationUnits[i]));
|
||||
i++;
|
||||
return pair;
|
||||
});
|
||||
|
||||
addTimeouts("Timeouts", t);
|
||||
|
|
Loading…
Reference in a new issue