Merge pull request #41 from vadi2/handle-null-path

Snapshot generation: handle lack of 'path'
This commit is contained in:
Grahame Grieve 2019-06-03 19:19:13 +10:00 committed by GitHub
commit 1ac568c963
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 3 deletions

View File

@ -1162,12 +1162,13 @@ public class Utilities {
}
public static String extractBaseUrl(String url) {
if (url.contains("/"))
if (url == null)
return null;
else if (url.contains("/"))
return url.substring(0, url.lastIndexOf("/"));
else
return url;
}
}
public static String listCanonicalUrls(Set<String> keys) {
return keys.toString();