forked from D-Net/dnet-hadoop
[Patch Hosted By] added fix to avoi NPE error when datasource official name is not provided. Removing datasources if no officialname has been provided
This commit is contained in:
parent
b42e2c9df6
commit
ec87149cb3
|
@ -113,27 +113,15 @@ object SparkProduceHostedByMap {
|
|||
}
|
||||
|
||||
def oaToHostedbyItemType(dats: Datasource): HostedByItemType = {
|
||||
if (dats.getJournal != null) {
|
||||
|
||||
if(dats.getOfficialname != null) {
|
||||
return getHostedByItemType(
|
||||
dats.getId,
|
||||
dats.getOfficialname.getValue,
|
||||
dats.getJournal.getIssnPrinted,
|
||||
dats.getJournal.getIssnOnline,
|
||||
dats.getJournal.getIssnLinking,
|
||||
false
|
||||
)
|
||||
}
|
||||
if (dats.getJournal != null && dats.getOfficialname != null) {
|
||||
return getHostedByItemType(
|
||||
dats.getId,
|
||||
"",
|
||||
dats.getOfficialname.getValue,
|
||||
dats.getJournal.getIssnPrinted,
|
||||
dats.getJournal.getIssnOnline,
|
||||
dats.getJournal.getIssnLinking,
|
||||
false
|
||||
)
|
||||
|
||||
}
|
||||
HostedByItemType("", "", "", "", "", false)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue