avoid NPE in URL.set when file is null

This commit is contained in:
Joel Dice
2014-04-23 08:40:08 -06:00
parent 5beb148df3
commit a41efb76c5
2 changed files with 4 additions and 1 deletions

View File

@ -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);