Closed Bug 1209037 Opened 10 years ago Closed 10 years ago

Eliminate some unneeded null checks

Categories

(Core :: DOM: Editor, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla44
Tracking Status
firefox44 --- fixed

People

(Reporter: ehsan.akhgari, Unassigned)

Details

Attachments

(1 file)

No description provided.
Attachment #8666674 - Flags: review?(josh)
Comment on attachment 8666674 [details] [diff] [review] Eliminate some unneeded null checks Review of attachment 8666674 [details] [diff] [review]: ----------------------------------------------------------------- ::: editor/libeditor/nsHTMLEditRules.cpp @@ +6588,5 @@ > nsCOMPtr<nsINode> rightParaNode = do_QueryInterface(rightPara); > NS_ENSURE_STATE(mHTMLEditor && rightParaNode); > nsCOMPtr<nsIDOMNode> child = > GetAsDOMNode(mHTMLEditor->GetLeftmostChild(rightParaNode, true)); > NS_ENSURE_STATE(mHTMLEditor); Want to remove this one too? @@ +7386,5 @@ > nsCOMPtr<nsIDOMNode> tmp = mNewBlock; > NS_ENSURE_STATE(mHTMLEditor); > tmp = GetAsDOMNode(mHTMLEditor->GetLastEditableChild(*block)); > uint32_t endPoint; > NS_ENSURE_STATE(mHTMLEditor); Ditto. @@ +7392,3 @@ > mHTMLEditor->IsContainer(tmp)) > { > NS_ENSURE_STATE(mHTMLEditor); And ditto. @@ +7405,5 @@ > else > { > // selection is before block. put at start of block. > nsCOMPtr<nsIDOMNode> tmp = mNewBlock; > NS_ENSURE_STATE(mHTMLEditor); There's an NS_ENSURE_STATE(mHTMLEditor) earlier in this method, and there's no clear reason why any intervening code should null this out. Your choice. @@ +7414,4 @@ > { > tmp = nsEditor::GetNodeLocation(tmp, &offset); > } > NS_ENSURE_STATE(mHTMLEditor); Ditto.
Attachment #8666674 - Flags: review?(josh) → review+
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla44
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: