From 58dd424de8781e852fbb4fac102273746120e5e2 Mon Sep 17 00:00:00 2001 From: Javier Ramos Date: Wed, 17 Apr 2019 18:33:52 +0200 Subject: [PATCH] Prevent potential NoneType not subscriptable Fix when data['extensions']['subAltNames']['names'] is none --- lemur/certificates/schemas.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lemur/certificates/schemas.py b/lemur/certificates/schemas.py index 1352f796..b807c760 100644 --- a/lemur/certificates/schemas.py +++ b/lemur/certificates/schemas.py @@ -123,7 +123,7 @@ class CertificateInputSchema(CertificateCreationSchema): data['extensions']['subAltNames'] = { 'names': [] } - elif not data['extensions']['subAltNames']['names']: + elif not data['extensions']['subAltNames'].get('names'): data['extensions']['subAltNames']['names'] = [] data['extensions']['subAltNames']['names'] += csr_sans return missing.convert_validity_years(data)