[ticket/13163] Terminate timely when no data-last links exist

PHPBB3-13163