From 4275941a62d0fd92873eac3ebe41460048aec8cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jon=20Gonz=C3=A1lez=20Garrido?= Date: Sun, 5 Nov 2023 18:21:46 +0100 Subject: [PATCH] Try to fix posible null value in isInFrontOf call (PSaml) --- src/Domain/Rule/DogAcrossToDogRule.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Domain/Rule/DogAcrossToDogRule.php b/src/Domain/Rule/DogAcrossToDogRule.php index cabf2a7..71b229e 100644 --- a/src/Domain/Rule/DogAcrossToDogRule.php +++ b/src/Domain/Rule/DogAcrossToDogRule.php @@ -23,6 +23,9 @@ public function __toString(): string protected function areDogsCorrectlyPlaced(Dog $firstDog, Dog $secondDog): bool { + if (!$firstDog->isPlaced() || !$secondDog->isPlaced()) { + return true; + } return $firstDog->getBoardPlace()->isInFrontOf($secondDog->getBoardPlace()); }