There are some cases where $order->getPayments()->last() can return false, and there are checks for if the returned value is null, but in some instances (notably src/Menu/AdminOrderShowMenuListener.php) where its possible for an order to have no payments (for example use of a gift voucher or 100% off discount code) and this would lead to 500 server errors.
There are some cases where
$order->getPayments()->last()
can return false, and there are checks for if the returned value is null, but in some instances (notablysrc/Menu/AdminOrderShowMenuListener.php
) where its possible for an order to have no payments (for example use of a gift voucher or 100% off discount code) and this would lead to 500 server errors.