From c5061de7820d5eca50cc9363a4d0c83438ffe635 Mon Sep 17 00:00:00 2001 From: aurimasv Date: Sat, 22 Sep 2012 18:43:13 -0500 Subject: [PATCH] Fix cleanDOI --- chrome/content/zotero/xpcom/utilities.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/chrome/content/zotero/xpcom/utilities.js b/chrome/content/zotero/xpcom/utilities.js index c5dba144d..eeaca7700 100644 --- a/chrome/content/zotero/xpcom/utilities.js +++ b/chrome/content/zotero/xpcom/utilities.js @@ -261,8 +261,9 @@ Zotero.Utilities = { if(typeof(x) != "string") { throw "cleanDOI: argument must be a string"; } - - return x.match(/10\.[0-9]{4,}\/[^\s]*[^\s\.,]/)[0]; + + var doi = x.match(/10\.[0-9]{4,}\/[^\s]*[^\s\.,]/); + return doi ? doi[0] : null; }, /**