Deals with possible nil values for links and pagination