   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

    if doaj.status isnt 'error'
      result.pure_oa = true
      result.provenance.push 'Confirmed journal is listed in DOAJ'
      result.publisher ?= doaj.data.bibjson.publisher
      result.journal_title ?= doaj.data.bibjson.title
    else
      result.provenance.push 'Could not find journal in DOAJ'


      result.confidence = 1 if not result.confidence
      result.publisher = crossref.publisher
      result.provenance.push 'Added publisher name from Crossref'
      if not result.issn and crossref.ISSN? and crossref.ISSN.length > 0
        result.issn = crossref.ISSN[0]
        result.provenance.push 'Added ISSN from Crossref'
      if not result.journal_title and crossref['container-title']? and crossref['container-title'].length > 0
        result.journal_title = crossref['container-title'][0]
        result.provenance.push 'Added journal title from Crossref'
      if not result.authors and crossref.author
        result.authors = crossref.author
        result.provenance.push 'Added author list from Crossref'
      if not result.title and crossref.title? and crossref.title.length > 0
        result.title = crossref.title[0]
        result.provenance.push 'Added article title from Crossref'
    else
