What happens if the url has a parse error? I can create a string that matches your URL regex above and yet will blow up here.