ctrapezoid_type may be None (modal)

This commit is contained in:
Jan Petykiewicz 2018-07-21 13:49:11 -07:00
parent 055b2b35af
commit 28cdb34b08

View File

@ -2116,7 +2116,7 @@ class CTrapezoid(Record):
if ctrapezoid_type in range(12, 16) and 2 * width > height: if ctrapezoid_type in range(12, 16) and 2 * width > height:
raise InvalidDataError('CTrapezoid has 2*width > height' raise InvalidDataError('CTrapezoid has 2*width > height'
' ({} > 2 * {})'.format(width, height)) ' ({} > 2 * {})'.format(width, height))
if ctrapezoid_type not in range(0, 26): if ctrapezoid_type is not None and ctrapezoid_type not in range(0, 26):
raise InvalidDataError('CTrapezoid has invalid type: ' raise InvalidDataError('CTrapezoid has invalid type: '
'{}'.format(ctrapezoid_type)) '{}'.format(ctrapezoid_type))