improve handling of undef url in render_related_url