Skip to content

Commit f714e70

Browse files
committed
fixed error when trying to export empty rule list to csv
1 parent fb5edde commit f714e70

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

niaarm/rule_list.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,10 @@ def to_csv(self, filename):
8383
filename (str): File to save the rules to.
8484
8585
"""
86+
if not self:
87+
print("No rules to output")
88+
return
89+
8690
with open(filename, "w", newline="") as f:
8791
writer = csv.writer(f)
8892

0 commit comments

Comments
 (0)