fix for bug#48472

apparently nsIContent::ChildAt can be successful
and not return a child. now checking fo that.
r: smfr
a: beppe
This commit is contained in:
anthonyd%netscape.com 2000-08-11 19:55:39 +00:00
parent df3cdee5ef
commit 9d506576cb
3 changed files with 6 additions and 3 deletions

View File

@ -4246,7 +4246,8 @@ nsDOMSelection::AddRange(nsIDOMRange* aRange)
nsCOMPtr<nsIContent> childAt;
if (NS_SUCCEEDED(content->ChildAt(startOffset, *getter_AddRefs(childAt))))
{
if (NS_SUCCEEDED(childAt->GetTag(atom)) && atom == nsSelection::sTableAtom)
if ( (childAt) &&
(NS_SUCCEEDED(childAt->GetTag(atom)) && atom == nsSelection::sTableAtom) )
{
mFrameSelection->mSelectingTableCellMode = TABLESELECTION_TABLE;
}

View File

@ -4246,7 +4246,8 @@ nsDOMSelection::AddRange(nsIDOMRange* aRange)
nsCOMPtr<nsIContent> childAt;
if (NS_SUCCEEDED(content->ChildAt(startOffset, *getter_AddRefs(childAt))))
{
if (NS_SUCCEEDED(childAt->GetTag(atom)) && atom == nsSelection::sTableAtom)
if ( (childAt) &&
(NS_SUCCEEDED(childAt->GetTag(atom)) && atom == nsSelection::sTableAtom) )
{
mFrameSelection->mSelectingTableCellMode = TABLESELECTION_TABLE;
}

View File

@ -4246,7 +4246,8 @@ nsDOMSelection::AddRange(nsIDOMRange* aRange)
nsCOMPtr<nsIContent> childAt;
if (NS_SUCCEEDED(content->ChildAt(startOffset, *getter_AddRefs(childAt))))
{
if (NS_SUCCEEDED(childAt->GetTag(atom)) && atom == nsSelection::sTableAtom)
if ( (childAt) &&
(NS_SUCCEEDED(childAt->GetTag(atom)) && atom == nsSelection::sTableAtom) )
{
mFrameSelection->mSelectingTableCellMode = TABLESELECTION_TABLE;
}