Closed Bug 58477 Opened 24 years ago Closed 23 years ago

GetRootContent and GetDocumentElement callers must null-check

Categories

(Core :: DOM: Core & HTML, defect, P3)

defect

Tracking

()

VERIFIED FIXED
mozilla0.9

People

(Reporter: dbaron, Assigned: dr)

Details

(Keywords: dom1)

Attachments

(4 files)

As vidur pointed out in bug 40121, we need to make sure that all callers of
nsIDocument::GetRootContent and nsIDOMDocument::GetDocumentElement check for
null, since these functions may return null in rare cases.
Looks good. r=blake
Thenks for the reviews (blake and scc), now there's only one place remaining
that needs to deal with null root element cases (possibly), that's at
http://lxr.mozilla.org/seamonkey/source/layout/xbl/src/nsXBLWindowHandler.cpp#193
so I'll let hyatt deal with that.
Assignee: jst → hyatt
OS: Linux → All
Hardware: PC → All
->moz0.9
Target Milestone: --- → mozilla0.9
->dr
Assignee: hyatt → dr
Status: NEW → ASSIGNED
this fixes this instance (looking for r=, etc...) but there are other places in
the code where these functions aren't null-checked (nsHTMLEditor.cpp and
nsXULElement.cpp to name a couple).

i'll check this in asap and then throw this back at jst, since he seemed to know
something about which calls should and shouldn't need null-checking.
Keywords: dom1
Component: DOM Level 1 → DOM Core
Keywords: review
r=jag
sr=hyatt. i'll check in when the tree opens.
checked in (cvs rev 1.5). jst, i'm marking this as fixed -- could you verify, if
there are indeed no more cases where this needs to be null-checked? i noticed
some calls in nsHTMLEditor.cpp, nsXULElement.cpp, but it sounded like you knew
something about those cases... thanks!
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Keywords: review
Resolution: --- → FIXED
QA contact Update
QA Contact: janc → desale
Updating QA contact to Shivakiran Tummala.
QA Contact: desale → stummala
johnny can u please verify this bug...
Verified.
Status: RESOLVED → VERIFIED
Component: DOM: Core → DOM: Core & HTML
QA Contact: stummala → general
You need to log in before you can comment on or make changes to this bug.