From 31501ac213a716dc47ea74d9a005f05319ccbee3 Mon Sep 17 00:00:00 2001 From: "uriber%gmail.com" Date: Fri, 22 Feb 2008 21:21:15 +0000 Subject: [PATCH] Don't crash on triple-clicking when there's an orphan content somewhere. bug=370174 r+sr=roc blocking1.9=dbaron git-svn-id: svn://10.0.0.236/trunk@246323 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/layout/generic/nsFrame.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mozilla/layout/generic/nsFrame.cpp b/mozilla/layout/generic/nsFrame.cpp index f17a4201256..c010ae95a45 100644 --- a/mozilla/layout/generic/nsFrame.cpp +++ b/mozilla/layout/generic/nsFrame.cpp @@ -4540,8 +4540,9 @@ FindBlockFrameOrBR(nsIFrame* aFrame, nsDirection aDirection) aFrame->GetType() == nsGkAtoms::brFrame) { nsIContent* content = aFrame->GetContent(); result.mContent = content->GetParent(); - result.mOffset = result.mContent->IndexOf(content) + - (aDirection == eDirPrevious ? 1 : 0); + if (result.mContent) + result.mOffset = result.mContent->IndexOf(content) + + (aDirection == eDirPrevious ? 1 : 0); return result; }