Modify logic for retrieving a trip object. [Fixes #57577866]