When the user manually sets somethinf invalid, eg.

    URI.parse("foo.com).port => nil

There's a migration to try an avoid this, but we can't easily stop them putting it back later, so this catches it and uses the old behaviour (from the browser) as a fallback