Make sure the returned URL is not null before it gets logged