[Patch Hosted By] added fix to avoi NPE error when datasource official name is not provided

This commit is contained in:
Miriam Baglioni 2022-09-19 12:30:32 +02:00
parent 1329aa8479
commit b42e2c9df6
1 changed files with 12 additions and 1 deletions

View File

@ -115,6 +115,7 @@ object SparkProduceHostedByMap {
def oaToHostedbyItemType(dats: Datasource): HostedByItemType = { def oaToHostedbyItemType(dats: Datasource): HostedByItemType = {
if (dats.getJournal != null) { if (dats.getJournal != null) {
if(dats.getOfficialname != null) {
return getHostedByItemType( return getHostedByItemType(
dats.getId, dats.getId,
dats.getOfficialname.getValue, dats.getOfficialname.getValue,
@ -124,6 +125,16 @@ object SparkProduceHostedByMap {
false false
) )
} }
return getHostedByItemType(
dats.getId,
"",
dats.getJournal.getIssnPrinted,
dats.getJournal.getIssnOnline,
dats.getJournal.getIssnLinking,
false
)
}
HostedByItemType("", "", "", "", "", false) HostedByItemType("", "", "", "", "", false)
} }