diff --git a/modules/ticket/back/methods/ticket/getPossibleStowaways.js b/modules/ticket/back/methods/ticket/getPossibleStowaways.js index 4ff5fa9d5..581a0a9c3 100644 --- a/modules/ticket/back/methods/ticket/getPossibleStowaways.js +++ b/modules/ticket/back/methods/ticket/getPossibleStowaways.js @@ -20,6 +20,10 @@ module.exports = Self => { Self.getPossibleStowaways = async ticketFk => { let ship = await Self.app.models.Ticket.findById(ticketFk); + + if (!ship || !ship.shipped) + return []; + let lowestDate = new Date(ship.shipped.getTime()); lowestDate.setHours(0, 0, -1, 0);