// 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);