Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2161)

Unified Diff: headless/public/util/generic_url_request_job.cc

Issue 2886403002: Add check for that reader is not null in GetPostData (Closed)
Patch Set: Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: headless/public/util/generic_url_request_job.cc
diff --git a/headless/public/util/generic_url_request_job.cc b/headless/public/util/generic_url_request_job.cc
index 3d93ee34d7a7890dfc5ffd90549696af7fef19ca..012f3ed732b58e4bb827fadb21a8113053109cae 100644
--- a/headless/public/util/generic_url_request_job.cc
+++ b/headless/public/util/generic_url_request_job.cc
@@ -272,6 +272,8 @@ std::string GenericURLRequestJob::GetPostData() const {
DCHECK_EQ(1u, stream->GetElementReaders()->size());
const net::UploadBytesElementReader* reader =
(*stream->GetElementReaders())[0]->AsBytesReader();
+ if (!reader)
+ return "";
return std::string(reader->bytes(), reader->length());
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698