Skip to content

Commit

Permalink
guard against null terms.getTermsOfUse() IQSS#3700
Browse files Browse the repository at this point in the history
  • Loading branch information
pdurbin committed Nov 29, 2017
1 parent ba9c6bd commit 84224bd
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/main/java/edu/harvard/iq/dataverse/DatasetVersion.java
Original file line number Diff line number Diff line change
Expand Up @@ -1344,7 +1344,11 @@ public String getJsonLd() {
if (TermsOfUseAndAccess.License.CC0.equals(terms.getLicense())) {
license.add("text", "CC0").add("url", "https://creativecommons.org/publicdomain/zero/1.0/");
} else {
license.add("text", terms.getTermsOfUse());
String termsOfUse = terms.getTermsOfUse();
// Terms of use can be null if you create the dataset with JSON.
if (termsOfUse != null) {
license.add("text", termsOfUse);
}
}

job.add("license",license);
Expand Down

0 comments on commit 84224bd

Please sign in to comment.