summaryrefslogtreecommitdiffstats
path: root/chrome/browser/download/download_util.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/download/download_util.cc')
-rw-r--r--chrome/browser/download/download_util.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/chrome/browser/download/download_util.cc b/chrome/browser/download/download_util.cc
index f00b40b..62ff15f 100644
--- a/chrome/browser/download/download_util.cc
+++ b/chrome/browser/download/download_util.cc
@@ -757,7 +757,9 @@ void CancelDownloadRequest(ResourceDispatcherHost* rdh,
int render_process_id,
int request_id) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
- rdh->CancelRequest(render_process_id, request_id, false);
+ // |rdh| may be NULL in unit tests.
+ if (rdh)
+ rdh->CancelRequest(render_process_id, request_id, false);
}
void NotifyDownloadInitiated(int render_process_id, int render_view_id) {