genhash: only assign url when url is empty