replaced null value with a more safe empty string as return value
This commit is contained in:
parent
c58db1c8ea
commit
1139d6568d
|
@ -166,7 +166,13 @@ public class PublicationToOaf implements Serializable {
|
|||
// Adding source
|
||||
final String source = getStringValue(rootElement, "sourceName");
|
||||
if (StringUtils.isNotBlank(source)) {
|
||||
publication.setSource(Arrays.asList(mapStringField(source, null)));
|
||||
Field<String> sourceField = mapStringField(source, null);
|
||||
if (sourceField==null) {
|
||||
publication.setSource(null);
|
||||
}
|
||||
else {
|
||||
publication.setSource(Arrays.asList(sourceField));
|
||||
}
|
||||
}
|
||||
|
||||
// Adding titles
|
||||
|
|
|
@ -20,7 +20,7 @@ public class DumpToActionsUtility {
|
|||
public static String getStringValue(final JsonObject root, final String key) {
|
||||
if (root.has(key) && !root.get(key).isJsonNull())
|
||||
return root.get(key).getAsString();
|
||||
return null;
|
||||
return new String("");
|
||||
}
|
||||
|
||||
public static List<String> getArrayValues(final JsonObject root, final String key) {
|
||||
|
|
Loading…
Reference in New Issue