Prevent potential NoneType not subscriptable

Fix when data['extensions']['subAltNames']['names'] is none
This commit is contained in:
Javier Ramos 2019-04-17 18:33:52 +02:00 committed by GitHub
parent 900ae10764
commit 58dd424de8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -123,7 +123,7 @@ class CertificateInputSchema(CertificateCreationSchema):
data['extensions']['subAltNames'] = { data['extensions']['subAltNames'] = {
'names': [] 'names': []
} }
elif not data['extensions']['subAltNames']['names']: elif not data['extensions']['subAltNames'].get('names'):
data['extensions']['subAltNames']['names'] = [] data['extensions']['subAltNames']['names'] = []
data['extensions']['subAltNames']['names'] += csr_sans data['extensions']['subAltNames']['names'] += csr_sans
return missing.convert_validity_years(data) return missing.convert_validity_years(data)