Return null if no URI is set

pull/17/merge
Richard Körber 2015-12-12 18:35:50 +01:00
parent 181042c42b
commit 04fe570811
1 changed files with 6 additions and 1 deletions

View File

@ -60,8 +60,13 @@ public class GenericChallenge implements Challenge {
@Override
public URI getUri() {
String uri = get(KEY_URI);
if (uri == null) {
return null;
}
try {
return new URI(get(KEY_URI).toString());
return new URI(uri);
} catch (URISyntaxException ex) {
throw new IllegalStateException("Invalid URI", ex);
}