Checking for null before deref: b=55358 r=a=buster

This commit is contained in:
attinasi%netscape.com 2000-09-26 21:00:32 +00:00
Родитель 66f020d558
Коммит 51307aaffd
2 изменённых файлов: 36 добавлений и 12 удалений

Просмотреть файл

@ -7965,9 +7965,15 @@ FindPreviousAnonymousSibling(nsIPresShell* aPresShell,
nsCOMPtr<nsIDocument> doc;
aContainer->GetDocument(*getter_AddRefs(doc));
NS_ASSERTION(doc, "null document from content element in FindPreviousAnonymousSibling");
if (doc) {
nsCOMPtr<nsIDOMDocumentXBL> xblDoc(do_QueryInterface(doc));
NS_ASSERTION(xblDoc, "null xblDoc for content element in FindPreviousAnonymousSibling");
if (xblDoc) {
nsCOMPtr<nsIDOMElement> elt(do_QueryInterface(aContainer));
xblDoc->GetAnonymousNodes(elt, getter_AddRefs(nodeList));
}
}
if (nodeList) {
PRUint32 ctr,listLength;
nsCOMPtr<nsIDOMNode> node;
@ -8031,9 +8037,15 @@ FindNextAnonymousSibling(nsIPresShell* aPresShell,
nsCOMPtr<nsIDocument> doc;
aContainer->GetDocument(*getter_AddRefs(doc));
NS_ASSERTION(doc, "null document from content element in FindNextAnonymousSibling");
if (doc) {
nsCOMPtr<nsIDOMDocumentXBL> xblDoc(do_QueryInterface(doc));
NS_ASSERTION(xblDoc, "null xblDoc for content element in FindNextAnonymousSibling");
if (xblDoc) {
nsCOMPtr<nsIDOMElement> elt(do_QueryInterface(aContainer));
xblDoc->GetAnonymousNodes(elt, getter_AddRefs(nodeList));
}
}
if (nodeList) {
PRUint32 ctr,listLength;
nsCOMPtr<nsIDOMNode> node;

Просмотреть файл

@ -7965,9 +7965,15 @@ FindPreviousAnonymousSibling(nsIPresShell* aPresShell,
nsCOMPtr<nsIDocument> doc;
aContainer->GetDocument(*getter_AddRefs(doc));
NS_ASSERTION(doc, "null document from content element in FindPreviousAnonymousSibling");
if (doc) {
nsCOMPtr<nsIDOMDocumentXBL> xblDoc(do_QueryInterface(doc));
NS_ASSERTION(xblDoc, "null xblDoc for content element in FindPreviousAnonymousSibling");
if (xblDoc) {
nsCOMPtr<nsIDOMElement> elt(do_QueryInterface(aContainer));
xblDoc->GetAnonymousNodes(elt, getter_AddRefs(nodeList));
}
}
if (nodeList) {
PRUint32 ctr,listLength;
nsCOMPtr<nsIDOMNode> node;
@ -8031,9 +8037,15 @@ FindNextAnonymousSibling(nsIPresShell* aPresShell,
nsCOMPtr<nsIDocument> doc;
aContainer->GetDocument(*getter_AddRefs(doc));
NS_ASSERTION(doc, "null document from content element in FindNextAnonymousSibling");
if (doc) {
nsCOMPtr<nsIDOMDocumentXBL> xblDoc(do_QueryInterface(doc));
NS_ASSERTION(xblDoc, "null xblDoc for content element in FindNextAnonymousSibling");
if (xblDoc) {
nsCOMPtr<nsIDOMElement> elt(do_QueryInterface(aContainer));
xblDoc->GetAnonymousNodes(elt, getter_AddRefs(nodeList));
}
}
if (nodeList) {
PRUint32 ctr,listLength;
nsCOMPtr<nsIDOMNode> node;