Skip to content

Commit 0f9d843

Browse files
committed
splitreports: handle empty string chunk_size
Handle bot parameter `chunk_size` values empty string, due to missing parameter typing checks
1 parent 806d81e commit 0f9d843

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ Please refer to the [NEWS](NEWS.md) for a list of changes which have an affect o
1616
### Configuration
1717

1818
### Core
19+
- `intelmq.lib.splitreports`: Handle bot parameter `chunk_size` values empty string, due to missing parameter typing checks (PR#2604 by Sebastian Wagner).
1920

2021
### Development
2122

intelmq/lib/splitreports.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ def generate_reports(report_template: Report, infile: BinaryIO, chunk_size: Opti
150150
Yields:
151151
report: a Report object holding the chunk in the raw field
152152
"""
153-
if chunk_size is None:
153+
if not chunk_size: # None, empty string or False
154154
report = report_template.copy()
155155
data = infile.read()
156156
if data:

0 commit comments

Comments
 (0)