Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6196)

Unified Diff: chrome/browser/profiles/profile_io_data.cc

Issue 2373753002: Avoid dereferencing nullptr during ProfileIOData destruction (Closed)
Patch Set: Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/profiles/profile_io_data.cc
diff --git a/chrome/browser/profiles/profile_io_data.cc b/chrome/browser/profiles/profile_io_data.cc
index 093aa98f3b304e7bba0856e3a47465e361811b82..3918a97877a2c9478f96c38ff6949a80702dcde1 100644
--- a/chrome/browser/profiles/profile_io_data.cc
+++ b/chrome/browser/profiles/profile_io_data.cc
@@ -1326,8 +1326,12 @@ void ProfileIOData::DestroyResourceContext() {
// notifications by severing the link between it and the
// cert_transparency_verifier_ and unregistering it from new STH
// notifications.
- cert_transparency_verifier_->SetObserver(nullptr);
- ct_tree_tracker_unregistration_.Run();
+ // Only do this if the profile was initalized and
+ // |cert_transparency_verifier_| is not null.
+ if (cert_transparency_verifier_) {
+ cert_transparency_verifier_->SetObserver(nullptr);
+ ct_tree_tracker_unregistration_.Run();
+ }
}
std::unique_ptr<net::HttpNetworkSession>
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698