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

Unified Diff: chrome/browser/android/download/download_controller.cc

Issue 2392673002: perform a null check in case WebContents doesn't have a ChromeDownloadDelegate (Closed)
Patch Set: Created 4 years, 2 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/android/download/download_controller.cc
diff --git a/chrome/browser/android/download/download_controller.cc b/chrome/browser/android/download/download_controller.cc
index 337b8ab62358f9e4b403d26def62ed649ef237f2..3768e1df89c515de902fd80251faae7edbcf349b 100644
--- a/chrome/browser/android/download/download_controller.cc
+++ b/chrome/browser/android/download/download_controller.cc
@@ -244,8 +244,12 @@ void DownloadController::OnDownloadStarted(
// Register for updates to the DownloadItem.
download_item->AddObserver(this);
- ChromeDownloadDelegate::FromWebContents(web_contents)->OnDownloadStarted(
- download_item->GetTargetFilePath().BaseName().value());
+ ChromeDownloadDelegate* delegate =
+ ChromeDownloadDelegate::FromWebContents(web_contents);
+ if (delegate) {
+ delegate->OnDownloadStarted(
+ download_item->GetTargetFilePath().BaseName().value());
+ }
}
void DownloadController::OnDownloadUpdated(DownloadItem* item) {
« 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