diff --git a/src/main/java/io/mola/galimatias/URLParser.java b/src/main/java/io/mola/galimatias/URLParser.java index 216f7c0..d6169bf 100644 --- a/src/main/java/io/mola/galimatias/URLParser.java +++ b/src/main/java/io/mola/galimatias/URLParser.java @@ -377,7 +377,7 @@ else if (c == '#') { host = (base == null)? null : base.host(); port = (base == null || base.port() == base.defaultPort())? -1 : base.port(); pathSegments = (base == null)? null : base.pathSegments(); - query = (base == null)? null : new StringBuilder(base.query()); + query = (base == null || base.query() == null)? null : new StringBuilder(base.query()); fragment = new StringBuilder(); state = ParseURLState.FRAGMENT; } else {