From 96c2ea501aaceee0447fe45d55181067cf022a23 Mon Sep 17 00:00:00 2001 From: Mylloon Date: Fri, 29 Dec 2023 01:35:52 +0100 Subject: [PATCH] fix crash on nullptr --- src/Plateau.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Plateau.cpp b/src/Plateau.cpp index 8493db0..595e21f 100644 --- a/src/Plateau.cpp +++ b/src/Plateau.cpp @@ -123,7 +123,7 @@ void Plateau::modifierSelection(const int x, const int 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 p->changeSelection(); selection = p;