orcid-no-doi #43
|
@ -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("");
|
||||
claudio.atzori
commented
Is the caller expecting the null? Otherwise this would likely produce a NPE. Is the caller expecting the null? Otherwise this would likely produce a NPE.
enrico.ottonello
commented
replaced null value with a more safe empty string replaced null value with a more safe empty string
|
||||
}
|
||||
|
||||
public static List<String> getArrayValues(final JsonObject root, final String key) {
|
||||
|
|
Loading…
Reference in New Issue
Is the caller expecting the
null
? Otherwise this would likely produce a NPE.yes, there is a check on null value