mirror of
https://github.com/corda/corda.git
synced 2025-01-07 05:28:51 +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.ref = ref;
|
||||
|
||||
int q = file.lastIndexOf('?');
|
||||
int q = file == null ? -1 : file.lastIndexOf('?');
|
||||
if (q != -1) {
|
||||
this.query = file.substring(q + 1);
|
||||
this.path = file.substring(0, q);
|
||||
|
@ -298,6 +298,9 @@ public class Misc {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
||||
expect(new URL("http://oss.readytalk.com")
|
||||
.getHost().equals("oss.readytalk.com"));
|
||||
|
||||
expect(java.util.Arrays.equals
|
||||
(new byte[] { 0, 0, 0, 0 },
|
||||
java.net.InetAddress.getByName("0.0.0.0").getAddress()));
|
||||
|
Loading…
Reference in New Issue
Block a user