Closed
Bug 1209037
Opened 10 years ago
Closed 10 years ago
Eliminate some unneeded null checks
Categories
(Core :: DOM: Editor, defect)
Core
DOM: Editor
Tracking
()
RESOLVED
FIXED
mozilla44
| Tracking | Status | |
|---|---|---|
| firefox44 | --- | fixed |
People
(Reporter: ehsan.akhgari, Unassigned)
Details
Attachments
(1 file)
|
2.45 KB,
patch
|
jdm
:
review+
|
Details | Diff | Splinter Review |
No description provided.
| Reporter | ||
Comment 1•10 years ago
|
||
Attachment #8666674 -
Flags: review?(josh)
Comment 2•10 years ago
|
||
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+
Comment 4•10 years ago
|
||
Status: NEW → RESOLVED
Closed: 10 years ago
status-firefox44:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla44
You need to log in
before you can comment on or make changes to this bug.
Description
•