util.extract_links: handle None input