relaton / relaton-nist

NistBib: retrieve NIST Standards for bibliographic use using the BibliographicItem model
https://www.metanorma.com
MIT License
2 stars 1 forks source link

NISTIR 8228 crashes #38

Closed opoudjis closed 4 years ago

opoudjis commented 4 years ago
* [[[FIPS199,NISTIR 8228]]], Federal Information Processing Standard 199, _Standards for Security Categorization of Federal Information and Information System_, February 2004. https://doi.org/10.6028/NIST.FIPS.199[https://doi.org/10.6028/NIST.FIPS.199].

In scrapper.rb:

def fetch_link(doc)
        links = []
        if doc.is_a? Hash
          links << { type: "uri", content: doc["uri"] } if doc["uri"]
          doi = "https://doi.org/" + doc["doi"] if doc["doi"]
        else
          pub = doc.at "//p/strong[.='Publication:']"
          pdf = pub.at "./following-sibling::a[.=' Local Download']"
          doi = pub.at("./following-sibling::a[contains(.,'(DOI)')]")&.attr :href
          links << { type: "pdf", content: pdf[:href] } if pdf
        end
        links << { type: "doi", content: doi } if doi
        links
      end

Crashes because pub is nil.

ronaldtse commented 4 years ago

Just wanted to point out that NISTIR 8228 is definitely not FIPS 199, but probably of no significance to the real issue.