diff options
author | Moonchild <moonchild@palemoon.org> | 2023-03-08 08:28:08 +0000 |
---|---|---|
committer | Moonchild <moonchild@palemoon.org> | 2023-03-08 08:28:08 +0000 |
commit | 713ada0ccff6982237ed3bfd952a00b4cf8e8a0f (patch) | |
tree | 874c45d48592d94efcedaa64380540ce9224add1 | |
parent | 9fafaedafbb62eabadcd251a1b74d6901325bd7b (diff) | |
parent | a4e18703e914534844b7acf9a399c2da693eb120 (diff) | |
download | uxp-713ada0ccff6982237ed3bfd952a00b4cf8e8a0f.tar.gz |
Merge pull request 'Follow-up: Ensure document is not null in nsImageLoadingContent::BindToTree' (#2147) from FranklinDM/UXP-contrib:work_wc-image-followup into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/2147
-rw-r--r-- | dom/base/nsImageLoadingContent.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/dom/base/nsImageLoadingContent.cpp b/dom/base/nsImageLoadingContent.cpp index 5e5e4666c4..f99c5c6a73 100644 --- a/dom/base/nsImageLoadingContent.cpp +++ b/dom/base/nsImageLoadingContent.cpp @@ -1413,13 +1413,15 @@ nsImageLoadingContent::BindToTree(nsIDocument* aDocument, nsIContent* aParent, bool aCompileEventHandlers) { // We may be getting connected and our image should be tracked. - if (GetOurCurrentDoc()) { - TrackImage(mCurrentRequest); - TrackImage(mPendingRequest); - } + nsCOMPtr<nsIDocument> doc = GetOurCurrentDoc(); + if (!doc) + return; + + TrackImage(mCurrentRequest); + TrackImage(mPendingRequest); if (mCurrentRequestFlags & REQUEST_BLOCKS_ONLOAD) - aDocument->BlockOnload(); + doc->BlockOnload(); } void |