Remove the dead !target check in AbstractRange.cpp
Categories
(Core :: DOM: Core & HTML, task)
Tracking
()
People
(Reporter: Sylvestre, Unassigned, Mentored)
References
(Blocks 1 open bug)
Details
(Keywords: good-first-bug, Whiteboard: [lang=c++])
Filing as a good first bug to learn workflows.
target is either &aNode or a root element that was just checked, so it can never be null here. Change if (!target || !target->IsContent()) to if (!target->IsContent()).
Current code:
if (!target || !target->IsContent()) {
return;
Link to the code:
https://searchfox.org/firefox-main/source/dom/base/AbstractRange.cpp
To verify the fix:
./mach build
./mach test dom/base/test --headless
This was reported by Coverity Scan (CID 1646871). The analyzer will stop reporting it once the change lands.
Tutorial to contribute:
https://firefox-source-docs.mozilla.org/contributing/contribution_quickref.html
https://firefox-source-docs.mozilla.org/contributing/stack_quickref.html
Please don't ask for the bug to be assigned. It will be automatically assigned to the first patch.
Description
•