Skip to content

Commit

Permalink
consolidate check on ogc_csw entity handler
Browse files Browse the repository at this point in the history
  • Loading branch information
eblondel committed Jan 6, 2025
1 parent 8f8f78a commit b925d64
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions inst/metadata/entity/entity_handler_ogc_csw.R
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,11 @@ handle_entities_csw <- function(handler, source, config, handle = TRUE){

#doi (in case available)
hasDOI = sapply(rec$identificationInfo[[1]]$citation$identifier, function(identifier){
has = !is.character(identifier$code) & !is.na(identifier$code)
if(has) has = regexpr(pattern = "dx.doi.org", identifier$code$attrs[["xlink:href"]]) > 0
has = FALSE
if(!is.null(identifier)){
has = !is.character(identifier$code) & !is.na(identifier$code)
if(has) has = regexpr(pattern = "dx.doi.org", identifier$code$attrs[["xlink:href"]]) > 0
}
return(has)
})
if(any(hasDOI)){
Expand Down

0 comments on commit b925d64

Please sign in to comment.