avoid NPE when url scheme is null, such as with "opaque" dns urls