www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | Submodules | README | LICENSE

commit 0c2b8e6016a429440ea872cf8fd638b44a2dbfc9
parent cff1bac7b9922b1a91eb23a67f6a1a93803c8cd4
Author: Simon Kornblith <simon@simonster.com>
Date:   Sun, 23 Sep 2012 08:40:36 -0700

Merge pull request #171 from aurimasv/cleanDOI

Fix cleanDOI
Diffstat:
Mchrome/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 @@ -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; }, /**