Fix NPE from URL->URI conversion

new URL(null) throws MUE
new URI(null) throws NPE
This commit is contained in:
zzz
2015-11-08 18:14:42 +00:00
parent 63ddf11799
commit bdde11c0ef

View File

@@ -875,11 +875,13 @@ public class TrackerClient implements Runnable {
}
/**
* @param ann an announce URL
* @param ann an announce URL, may be null, returns false if null
* @return true for i2p hosts only
* @since 0.7.12
*/
public static boolean isValidAnnounce(String ann) {
if (ann == null)
return false;
URI url;
try {
url = new URI(ann);