commit 47be01a6ae1f53a3a3a5308a544557f4d3e6af47 parent 3f9e9d0cf4d1fb1953a85df1f1fcebe8b91b16f1 Author: Dan Stillman <dstillman@zotero.org> Date: Wed, 27 May 2009 08:12:20 +0000 Handle missing rel attribute on matching <link> in DC prefix search Diffstat:
| M | translators/Embedded RDF.js | | | 8 | +++++--- |
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/translators/Embedded RDF.js b/translators/Embedded RDF.js @@ -23,9 +23,11 @@ function getDCPrefix(doc) { for(var i=0; i<links.length; i++) { if(links[i].getAttribute("href") == _dc) { var rel = links[i].getAttribute("rel"); - var matches = rel.match(/^schema\.([a-zA-Z]+)/); - if(matches) { - _prefix = matches[1].toLowerCase() + "."; + if(rel) { + var matches = rel.match(/^schema\.([a-zA-Z]+)/); + if(matches) { + _prefix = matches[1].toLowerCase() + "."; + } } break; }