Bug 1230918 - remove useless null-pointer check on aChild that only caused a Coverity - Dereference before null check. r=dbaron

MozReview-Commit-ID: JzpMNHYEpgu

--HG--
extra : rebase_source : 98c9007ef160bffa18a847bc722de29d2719a454
This commit is contained in:
Bogdan Postelnicu 2016-02-10 11:54:45 +02:00
parent 4ae855e98c
commit 46186eac3d

View File

@ -4296,14 +4296,12 @@ PresShell::ContentRemoved(nsIDocument *aDocument,
// We should check that aChild does not contain pointer capturing elements.
// If it does we should release the pointer capture for the elements.
if (aChild) {
for (auto iter = gPointerCaptureList->Iter(); !iter.Done(); iter.Next()) {
nsIPresShell::PointerCaptureInfo* data = iter.UserData();
if (data && data->mOverrideContent &&
nsContentUtils::ContentIsDescendantOf(data->mOverrideContent,
aChild)) {
nsIPresShell::ReleasePointerCapturingContent(iter.Key());
}
for (auto iter = gPointerCaptureList->Iter(); !iter.Done(); iter.Next()) {
nsIPresShell::PointerCaptureInfo* data = iter.UserData();
if (data && data->mOverrideContent &&
nsContentUtils::ContentIsDescendantOf(data->mOverrideContent,
aChild)) {
nsIPresShell::ReleasePointerCapturingContent(iter.Key());
}
}