Skip to content

Commit 9e94230

Browse files
michael-koellermroethke
authored andcommitted
Fix TypeError when creating ValidationResult without a reason
1 parent d2c5d6e commit 9e94230

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

rtrlib/rtr_manager.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -468,7 +468,7 @@ def __init__(self,
468468
for record in ffi.unpack(reason_records[0], reason_len):
469469
self._reason.append(Reason(prefix_length, asn, record))
470470

471-
elif (not ffi.typeof(reason_records) is ffi.typeof('struct pfx_record **')):
471+
elif (reason_records and not ffi.typeof(reason_records) is ffi.typeof('struct pfx_record **')):
472472
raise TypeError("reason_records must be struct pfx_record **")
473473
else:
474474
self._reason = None

0 commit comments

Comments
 (0)