Fix TypeError when get_tags is None