Fix StackZone crash when divideCardSpaceInZone overflows (#5751)

The divideCardSpaceInZone function introduced in #4930 is buggy and
sometimes returns an index that is too large for the current zone, which
causes us to call `cards.at(index)` with an `index` that's bigger than
the amount of cards.

This is the bug that #5609 intended to fix but was improperly diagnosed.
Remove part of #5609 as the cases it is guarding against (e.g. null card
pointer) cannot actually happen.
This commit is contained in:
Basile Clement 2025-03-21 01:30:46 +01:00 committed by GitHub
parent 2e01dfd23a
commit 76fa87c63e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 14 additions and 19 deletions

View file

@ -3,8 +3,6 @@
#include "select_zone.h"
inline Q_LOGGING_CATEGORY(StackZoneLog, "stack_zone");
class StackZone : public SelectZone
{
Q_OBJECT