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) { |