Prevent from crashes when url doesn't exists

Cherry picked from 3655b79..0d62434