Fix bug: code path with invalid links