| Index: content/browser/android/download_controller_android_impl.cc
|
| diff --git a/content/browser/android/download_controller_android_impl.cc b/content/browser/android/download_controller_android_impl.cc
|
| index 2bd324ab2d60f460b7ba2bf7d77eb2698ae09691..db47058548f5cd92ce5dfe17047fb40b10356c39 100644
|
| --- a/content/browser/android/download_controller_android_impl.cc
|
| +++ b/content/browser/android/download_controller_android_impl.cc
|
| @@ -235,16 +235,18 @@ void DownloadControllerAndroidImpl::StartAndroidDownload(
|
| }
|
|
|
| void DownloadControllerAndroidImpl::OnPostDownloadStarted(
|
| - WebContents* web_contents,
|
| DownloadItem* download_item) {
|
| DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
|
| + if (!download_item->GetWebContents())
|
| + return;
|
| +
|
| JNIEnv* env = AttachCurrentThread();
|
|
|
| // Register for updates to the DownloadItem.
|
| download_item->AddObserver(this);
|
|
|
| ScopedJavaLocalRef<jobject> view =
|
| - GetContentViewCoreFromWebContents(web_contents);
|
| + GetContentViewCoreFromWebContents(download_item->GetWebContents());
|
| if(view.is_null()) {
|
| // The view went away. Can't proceed.
|
| return;
|
|
|