|
if (!travel) throw req.reject (404, `Travel "${travel.ID}" does not exist; may have been deleted meanwhile.`) |
Here you're trying to read travel.ID after checking that travel is not defined. I assume trying this will crash it due to trying to read a property of something undefined.