Upstream version 10.39.225.0
[platform/framework/web/crosswalk.git] / src / net / cert / x509_certificate_nss.cc
index 9e95413..9019625 100644 (file)
@@ -141,7 +141,7 @@ bool X509Certificate::IsIssuedByEncoded(
 // static
 bool X509Certificate::GetDEREncoded(X509Certificate::OSCertHandle cert_handle,
                                     std::string* encoded) {
-  if (!cert_handle->derCert.len)
+  if (!cert_handle || !cert_handle->derCert.len)
     return false;
   encoded->assign(reinterpret_cast<char*>(cert_handle->derCert.data),
                   cert_handle->derCert.len);