diff --git a/src/ulo-storage-applications/src/main/java/info/mathhub/uloapi/query/Meta.java b/src/ulo-storage-applications/src/main/java/info/mathhub/uloapi/query/Meta.java index cbd263d314057d73aa8b29714764f1184c1a48a0..346463d11d178bd3ca528dd36e6235f9c9eb245f 100644 --- a/src/ulo-storage-applications/src/main/java/info/mathhub/uloapi/query/Meta.java +++ b/src/ulo-storage-applications/src/main/java/info/mathhub/uloapi/query/Meta.java @@ -28,15 +28,15 @@ public class Meta { public String paratype; public String getName() { - return this.name; + return this.nonNullString(this.name); } public String getSourceref() { - return this.sourceref; + return this.nonNullString(this.sourceref); } public String getParatype() { - return this.paratype; + return this.nonNullString(this.paratype); } @Override @@ -47,4 +47,15 @@ public class Meta { ); } + /** + * @return Return argument {@code s} if {@code s} is not {@code null}. + * If {@code} s} is {@code null}, return an empty {@code String}. + */ + private String nonNullString(String s) { + if (s == null) { + return ""; + } else { + return s; + } + } }