mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-24 21:31:04 +00:00
Bug 1208884 - Fix a few null check ordering bugs in nsHTMLEditRules::SplitParagraph; r=roc
Found by Viva64.
This commit is contained in:
parent
74504dc15a
commit
ed270af4ab
@ -6590,7 +6590,8 @@ nsHTMLEditRules::SplitParagraph(nsIDOMNode *aPara,
|
||||
nsCOMPtr<nsIDOMNode> child =
|
||||
GetAsDOMNode(mHTMLEditor->GetLeftmostChild(rightParaNode, true));
|
||||
NS_ENSURE_STATE(mHTMLEditor);
|
||||
if (mHTMLEditor->IsTextNode(child) || !mHTMLEditor ||
|
||||
if (!mHTMLEditor ||
|
||||
mHTMLEditor->IsTextNode(child) ||
|
||||
mHTMLEditor->IsContainer(child))
|
||||
{
|
||||
NS_ENSURE_STATE(mHTMLEditor);
|
||||
@ -7389,7 +7390,8 @@ nsHTMLEditRules::PinSelectionToNewBlock(Selection* aSelection)
|
||||
tmp = GetAsDOMNode(mHTMLEditor->GetLastEditableChild(*block));
|
||||
uint32_t endPoint;
|
||||
NS_ENSURE_STATE(mHTMLEditor);
|
||||
if (mHTMLEditor->IsTextNode(tmp) || !mHTMLEditor ||
|
||||
if (!mHTMLEditor ||
|
||||
mHTMLEditor->IsTextNode(tmp) ||
|
||||
mHTMLEditor->IsContainer(tmp))
|
||||
{
|
||||
NS_ENSURE_STATE(mHTMLEditor);
|
||||
@ -7410,7 +7412,8 @@ nsHTMLEditRules::PinSelectionToNewBlock(Selection* aSelection)
|
||||
NS_ENSURE_STATE(mHTMLEditor);
|
||||
tmp = GetAsDOMNode(mHTMLEditor->GetFirstEditableChild(*block));
|
||||
int32_t offset;
|
||||
if (!(mHTMLEditor->IsTextNode(tmp) || !mHTMLEditor ||
|
||||
if (mHTMLEditor &&
|
||||
!(mHTMLEditor->IsTextNode(tmp) ||
|
||||
mHTMLEditor->IsContainer(tmp)))
|
||||
{
|
||||
tmp = nsEditor::GetNodeLocation(tmp, &offset);
|
||||
|
Loading…
Reference in New Issue
Block a user