   if not result.licence or result.licence not in ['cc-by','cc-zero']
     publisher_licence_check_ran = true
     url = API.http.resolve('https://doi.org/'+result.doi) if result.doi
-    if url and url.indexOf('europepmc') is -1 # if it resolves to eupmc then it would already have been checked above
+    if url? and typeof url is 'string' and url.indexOf('europepmc') is -1 # if it resolves to eupmc then it would already have been checked above
       lic = API.service.lantern.licence url
       if lic.licence and lic.licence isnt 'unknown'
         result.licence = lic.licence

      try journal = romeo.journals[0].journal[0]
      try publisher = romeo.publishers[0].publisher[0]
      if not result.journal_title
        if journal?.jtitle and journal.jtitle.length > 0
          result.journal_title = journal.jtitle[0]
          result.provenance.push 'Added journal title from Sherpa Romeo'
        else
          result.provenance.push 'Tried, but could not add journal title from Sherpa Romeo.'
      if not result.publisher
        if publisher?.name and publisher.name.length > 0
          result.publisher = publisher.name[0]
          result.provenance.push 'Added publisher from Sherpa Romeo'
        else

      if not result.authors and core.authors
        result.authors = core.author
        result.provenance.push 'Added authors from CORE'
      if core.repositories? and core.repositories.length > 0
        for rep in core.repositories
          rc = {name:rep.name}
          rc.oai = rep.oai if rep.oai?
