Bug 1024966 - Check mResultContent before using it. r=roc

This commit is contained in:
Morris Tseng 2014-07-09 02:21:00 +02:00
parent 1716725017
commit e6c58de728

View File

@ -469,7 +469,8 @@ SelectionCarets::UpdateSelectionCarets()
false);
startFrame->PeekOffset(&pos);
nsCOMPtr<nsIContent> endContent = do_QueryInterface(range->GetEndParent());
if (nsLayoutUtils::CompareTreePosition(pos.mResultContent, endContent) > 0 ||
if ((pos.mResultContent &&
nsLayoutUtils::CompareTreePosition(pos.mResultContent, endContent) > 0) ||
(pos.mResultContent == endContent &&
pos.mContentOffset >= range->EndOffset())) {
isTilt = true;