diff --git a/src/Entity/CommerceTicket.php b/src/Entity/CommerceTicket.php index 7a0ce68..c9b97d2 100644 --- a/src/Entity/CommerceTicket.php +++ b/src/Entity/CommerceTicket.php @@ -380,7 +380,13 @@ class CommerceTicket extends ContentEntityBase implements CommerceTicketInterfac * The workflow ID. */ public static function getWorkflowId(CommerceTicketInterface $ticket) { - return CommerceTicketType::load($ticket->bundle())->getWorkflowId(); + $ticketType = CommerceTicketType::load($ticket->bundle()); + if ($ticketType) { + return $ticketType->getWorkflowId(); + } else { + // Handle the case where the ticket type is not found. + return null; + } } /**