diff options
author | rdsmith@chromium.org <rdsmith@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-11-04 15:03:37 +0000 |
---|---|---|
committer | rdsmith@chromium.org <rdsmith@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-11-04 15:03:37 +0000 |
commit | c2acd3060833a033d717f0c8c31ab698aa87bd5c (patch) | |
tree | c2b413a9b5f638dce888799f08de4c76b8b85ae2 /content | |
parent | f4390b24fb3a4544ea3c8282205296891ae22e1e (diff) | |
download | chromium_src-c2acd3060833a033d717f0c8c31ab698aa87bd5c.zip chromium_src-c2acd3060833a033d717f0c8c31ab698aa87bd5c.tar.gz chromium_src-c2acd3060833a033d717f0c8c31ab698aa87bd5c.tar.bz2 |
Check request handle existence in MatchQuery.
Request_handles are null in DownloadItems generated from the history;
any methods that may be called on such download items need to work with
null request handles.
BUG=102933
Review URL: http://codereview.chromium.org/8465001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@108653 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content')
-rw-r--r-- | content/browser/download/download_item.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/content/browser/download/download_item.cc b/content/browser/download/download_item.cc index b8dfbd1..25e7ead 100644 --- a/content/browser/download/download_item.cc +++ b/content/browser/download/download_item.cc @@ -643,7 +643,8 @@ bool DownloadItem::MatchesQuery(const string16& query) const { // L"/\x4f60\x597d\x4f60\x597d", // "/%E4%BD%A0%E5%A5%BD%E4%BD%A0%E5%A5%BD" std::string languages; - TabContents* tab = request_handle_->GetTabContents(); + TabContents* tab = (request_handle_.get() ? + request_handle_->GetTabContents() : NULL); if (tab) languages = content::GetContentClient()->browser()->GetAcceptLangs(tab); string16 url_formatted(net::FormatUrl(GetURL(), languages)); |