Permalink
Browse files

OR-10869

  • Loading branch information...
Jason Dooley authored and etgryphon committed Apr 14, 2011
1 parent 1f0abd7 commit 37a25160b9157678172b9282198ab65155eb402d
Showing with 1 addition and 1 deletion.
  1. +1 −1 frameworks/foundation/views/content_editable.js
@@ -1698,7 +1698,7 @@ SCUI.ContentEditableView = SC.WebView.extend(SC.Editable,
// endContainer is the BODY, endContainer's offset child is the BR tag, the previous sibling from that is your 'A'
// also works for end of the document, where there's an implicit BR created automatically for you
// fortunately, this works even if the selected range was styled, because the a tag went around the styles
- if (!node && (range.endContainer.childNodes[range.endOffset] && range.endContainer.childNodes[range.endOffset].previousSibling.tagName === 'A')) {
+ if (!node && (range.endContainer.childNodes[range.endOffset] && range.endContainer.childNodes[range.endOffset].previousSibling && range.endContainer.childNodes[range.endOffset].previousSibling.tagName === 'A')) {
node = range.endContainer.childNodes[range.endOffset].previousSibling;
}
}

0 comments on commit 37a2516

Please sign in to comment.