metrics: 'Send' method crashes on NULL ErrorPtr
TEST=manually tested on panther_embedded BUG=none Change-Id: Iced380180918839d34a46e1cb2743a4cffdd5b4c Reviewed-on: https://chromium-review.googlesource.com/220780 Reviewed-by: Bertrand Simonnet <bsimonnet@chromium.org> Commit-Queue: Nathan Bullock <nathanbullock@google.com> Tested-by: Nathan Bullock <nathanbullock@google.com>
This commit is contained in:
parent
dfea2f8992
commit
52d9edb590
1 changed files with 3 additions and 1 deletions
|
|
@ -29,7 +29,9 @@ bool HttpSender::Send(const std::string& content,
|
|||
chromeos::http::Transport::CreateDefault(),
|
||||
&error);
|
||||
if (!response || response->GetDataAsString() != "OK") {
|
||||
DLOG(ERROR) << "Failed to send data: " << error->GetMessage();
|
||||
if (error) {
|
||||
DLOG(ERROR) << "Failed to send data: " << error->GetMessage();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue