Closed Bug 1432401 Opened 8 years ago Closed 8 years ago

Useless NS_ENSURE_TRUE in editor/libeditor/TextEditorDataTransfer.cpp

Categories

(Core :: DOM: Editor, enhancement, P3)

enhancement

Tracking

()

RESOLVED FIXED
Tracking Status
firefox60 --- affected

People

(Reporter: arai, Unassigned)

Details

(Whiteboard: [good first bug][lang=c++])

https://searchfox.org/mozilla-central/rev/b7e3ec2468d42fa59d86c03ec7afeb209813f1d4/editor/libeditor/TextEditorDataTransfer.cpp#185 > nsCOMPtr<nsIDOMDocument> srcdomdoc; > if (sourceNode) { > sourceNode->GetOwnerDocument(getter_AddRefs(srcdomdoc)); > NS_ENSURE_TRUE(sourceNode, NS_ERROR_FAILURE); `NS_ENSURE_TRUE(sourceNode, NS_ERROR_FAILURE);` there is useless since it dereferences sourceNode in the previous line. I guess it should check `srcdomdoc` instead?
Priority: -- → P3
Whiteboard: [good first bug][lang=c++]
hey I would like to work on this...can you tell me what to do exactly? (just remove 'NS_ENSURE_TRUE(sourceNode, NS_ERROR_FAILURE);')
Flags: needinfo?(arai.unmht)
(In reply to Videet Singhai from comment #1) > hey I would like to work on this...can you tell me what to do exactly? (just > remove 'NS_ENSURE_TRUE(sourceNode, NS_ERROR_FAILURE);') I think, it's supposed to be checking srcdomdoc, instead of sourceNode. So, replace sourceNode with srcdomdoc maybe?
Flags: needinfo?(arai.unmht) → needinfo?(m_kato)
I think in the latest build this bug is resolved, can u check?
oh, indeed. thank you for your comment :)
Status: NEW → RESOLVED
Closed: 8 years ago
Flags: needinfo?(m_kato)
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.