fix NPE — url could be in any form, so, parsed can be null

This commit is contained in:
Vladimir Krivosheev
2013-11-29 14:38:47 +01:00
parent 9d05ff2953
commit ec22c2e0f8
@@ -44,11 +44,16 @@ public final class Urls {
@NotNull
public static Url newFromEncoded(@NotNull String url) {
Url result = parse(url, false);
Url result = parseEncoded(url);
LOG.assertTrue(result != null, url);
return result;
}
@Nullable
public static Url parseEncoded(@NotNull String url) {
return parse(url, false);
}
@NotNull
public static Url newHttpUrl(@NotNull String authority, @Nullable String path) {
return new UrlImpl("http", authority, path);