1
0
Fork 0

added check for null value during doi normalization

This commit is contained in:
Miriam Baglioni 2021-07-05 16:22:38 +02:00
parent 0892cad4e8
commit 7177c25261
1 changed files with 2 additions and 0 deletions

View File

@ -358,6 +358,8 @@ object DoiBoostMappingUtil {
def isEmpty(x: String) = x == null || x.trim.isEmpty
def normalizeDoi(input : String) :String ={
if(input == null)
return null
val replaced = input.replaceAll("(?:\\n|\\r|\\t|\\s)", "").toLowerCase.replaceFirst(DOI_PREFIX_REGEX, DOI_PREFIX)
if (isEmpty(replaced))
return null