diff --git a/src/Controller/AdminOrderController.php b/src/Controller/AdminOrderController.php index a81e2fee..89f8c57b 100644 --- a/src/Controller/AdminOrderController.php +++ b/src/Controller/AdminOrderController.php @@ -329,7 +329,7 @@ public function detailAction( $quantity = null; // get avatar - $user = User::getById($note->getUser()); + $user = $note->getUser() ? User::getById($note->getUser()) : null; $avatar = $user ? sprintf('/admin/user/get-image?id=%d', $user->getId()) : null; // group events diff --git a/src/PricingManager/Condition/VoucherToken.php b/src/PricingManager/Condition/VoucherToken.php index c9197016..60fc9b02 100644 --- a/src/PricingManager/Condition/VoucherToken.php +++ b/src/PricingManager/Condition/VoucherToken.php @@ -59,11 +59,7 @@ public function check(EnvironmentInterface $environment): bool public function checkVoucherCode(string $code): bool { - if (in_array(VoucherServiceToken::getByCode($code)->getVoucherSeriesId(), $this->allowListIds)) { - return true; - } - - return false; + return in_array(VoucherServiceToken::getByCode($code)?->getVoucherSeriesId(), $this->allowListIds); } public function toJSON(): string