Fix Objects.toString() calls to return empty string if null

This commit is contained in:
Tim Donohue
2020-02-19 16:51:28 -06:00
parent fb8ef5044b
commit 280ccac20c

View File

@@ -140,8 +140,8 @@ public class PersonAuthorityValue extends AuthorityValue {
@Override @Override
public void setValues(SolrDocument document) { public void setValues(SolrDocument document) {
super.setValues(document); super.setValues(document);
this.firstName = Objects.toString(document.getFieldValue("first_name")); this.firstName = Objects.toString(document.getFieldValue("first_name"), "");
this.lastName = Objects.toString(document.getFieldValue("last_name")); this.lastName = Objects.toString(document.getFieldValue("last_name"), "");
nameVariants = new ArrayList<String>(); nameVariants = new ArrayList<String>();
Collection<Object> document_name_variant = document.getFieldValues("name_variant"); Collection<Object> document_name_variant = document.getFieldValues("name_variant");
if (document_name_variant != null) { if (document_name_variant != null) {