mirror of
https://github.com/corda/corda.git
synced 2025-01-23 04:48:09 +00:00
Merge pull request #244 from dicej/url-set
avoid NPE in URL.set when file is null
This commit is contained in:
commit
3586481c8e
@ -103,7 +103,7 @@ public final class URL {
|
|||||||
this.file = file;
|
this.file = file;
|
||||||
this.ref = ref;
|
this.ref = ref;
|
||||||
|
|
||||||
int q = file.lastIndexOf('?');
|
int q = file == null ? -1 : file.lastIndexOf('?');
|
||||||
if (q != -1) {
|
if (q != -1) {
|
||||||
this.query = file.substring(q + 1);
|
this.query = file.substring(q + 1);
|
||||||
this.path = file.substring(0, q);
|
this.path = file.substring(0, q);
|
||||||
|
@ -298,6 +298,9 @@ public class Misc {
|
|||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
expect(new URL("http://oss.readytalk.com")
|
||||||
|
.getHost().equals("oss.readytalk.com"));
|
||||||
|
|
||||||
expect(java.util.Arrays.equals
|
expect(java.util.Arrays.equals
|
||||||
(new byte[] { 0, 0, 0, 0 },
|
(new byte[] { 0, 0, 0, 0 },
|
||||||
java.net.InetAddress.getByName("0.0.0.0").getAddress()));
|
java.net.InetAddress.getByName("0.0.0.0").getAddress()));
|
||||||
|
Loading…
Reference in New Issue
Block a user