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
This commit is contained in:
Sean Harvey 2009-12-16 05:40:20 +00:00
parent 298ef035ed
commit 92439f2a1d

View File

@ -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(/"$/, ''));