From 92439f2a1dd589e1f29bca1cca00ba987770d264 Mon Sep 17 00:00:00 2001 From: Sean Harvey Date: Wed, 16 Dec 2009 05:40:20 +0000 Subject: [PATCH] BUGFIX: match returns null on not-found, querying raw.length resulted in an error. Now it's possible to add links to the page again. (from r94378) git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@95604 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- javascript/tiny_mce_improvements.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/javascript/tiny_mce_improvements.js b/javascript/tiny_mce_improvements.js index 633a5b3eb..7ab7a224b 100755 --- a/javascript/tiny_mce_improvements.js +++ b/javascript/tiny_mce_improvements.js @@ -58,7 +58,7 @@ LinkForm.prototype = { getAnchors: function() { var raw = tinyMCE.activeEditor.getContent().match(/name="([a-zA-Z0-9-_]+?)"/gim); - if (raw.length) { + if (raw && raw.length) { var anchors = new Array(); for(var i = 0; i < raw.length; i++) { anchors.push(raw[i].substr(6).replace(/"$/, ''));