Skip to content

Commit

Permalink
Don't try to provide search for bogus id.
Browse files Browse the repository at this point in the history
  • Loading branch information
waynebeaton committed Dec 4, 2020
1 parent 22eaeb5 commit aba7d20
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,10 @@ public void close() {
private void describe(LicenseData licenseData) {
output.println(String.format("* [ ] %s", licenseData.getId()));
licenseData.contentData().forEach(data -> describeItem(data));
output.println(String.format(" - [Search IPZilla](%s)", getIPZillaSearchUrl(licenseData)));
String searchUrl = getIPZillaSearchUrl(licenseData);
if (searchUrl != null) {
output.println(String.format(" - [Search IPZilla](%s)", searchUrl));
}
IContentId id = licenseData.getId();
if ("maven".equals(id.getType()) && "mavencentral".equals(id.getSource())) {
output.println(String.format(" - [Maven Central](https://search.maven.org/artifact/%s/%s/%s/jar)",
Expand Down Expand Up @@ -105,6 +108,9 @@ private void describeItem(IContentData data) {
}

private String getIPZillaSearchUrl(LicenseData licenseData) {
if (!licenseData.getId().isValid())
return null;

var terms = new HashSet<String>();

String namespace = licenseData.getId().getNamespace();
Expand Down

0 comments on commit aba7d20

Please sign in to comment.