Skip to content

Commit

Permalink
fixed remaining nullpointer for licenses without image url
Browse files Browse the repository at this point in the history
  • Loading branch information
ErykKul authored and qqmyers committed Mar 17, 2022
1 parent 2718c57 commit 993f85e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,7 @@ public static String getLicenseURI(DatasetVersion dsv) {

public static String getLicenseIcon(DatasetVersion dsv) {
License license = dsv.getTermsOfUseAndAccess().getLicense();
return license != null ? license.getIconUrl().toString() : null;
return license != null && license.getIconUrl() != null ? license.getIconUrl().toString() : null;
}

public static String getLicenseDescription(DatasetVersion dsv) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -798,7 +798,7 @@ public static JsonObjectBuilder json(License license) {
.add("name", license.getName())
.add("shortDescription", license.getShortDescription())
.add("uri", license.getUri().toString())
.add("iconUrl", license.getIconUrl().toString())
.add("iconUrl", license.getIconUrl() == null ? null : license.getIconUrl().toString())
.add("active", license.isActive())
.add("isDefault", license.isDefault());
}
Expand Down

0 comments on commit 993f85e

Please sign in to comment.