fix crash on nullptr

This commit is contained in:
Mylloon 2023-12-29 01:35:52 +01:00
parent 7f59b11975
commit 96c2ea501a
Signed by: Anri
GPG key ID: A82D63DFF8D1317F

View file

@ -123,7 +123,7 @@ void Plateau::modifierSelection(const int x, const int y) {
} }
Piece *p = getPiece(x, y); Piece *p = getPiece(x, y);
if (p != selection) { if (p && p != selection) {
// Si la sélection à changer alors changer l'état de la nouvelle pièce // Si la sélection à changer alors changer l'état de la nouvelle pièce
p->changeSelection(); p->changeSelection();
selection = p; selection = p;