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

Unified Diff: content/browser/devtools/protocol/security_handler.cc

Issue 2337783005: Fix crash when displaying a null certificate. (Closed)
Patch Set: Created 4 years, 3 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: content/browser/devtools/protocol/security_handler.cc
diff --git a/content/browser/devtools/protocol/security_handler.cc b/content/browser/devtools/protocol/security_handler.cc
index 168bd5ec5bd7bd10c2d64b62e8ea4a22494aec8c..f3ff1405037807ebee3a516939dd5fa40abbf1bc 100644
--- a/content/browser/devtools/protocol/security_handler.cc
+++ b/content/browser/devtools/protocol/security_handler.cc
@@ -156,6 +156,8 @@ Response SecurityHandler::ShowCertificateViewer() {
WebContents* web_contents = WebContents::FromRenderFrameHost(host_);
scoped_refptr<net::X509Certificate> certificate = web_contents->
GetController().GetLastCommittedEntry()->GetSSL().certificate;
+ if (!certificate)
+ return Response::InternalError("Could not find certificate");
web_contents->GetDelegate()->ShowCertificateViewerInDevTools(
web_contents, certificate);
return Response::OK();
« 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