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..999b407237d10c0a5877551ea84d148b2c37665a 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() == NULL) |
benjhayden
2012/12/20 21:09:14
I thought the convention was if (!GetWebContents()
asanka
2012/12/20 22:41:19
Done.
|
+ 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; |