Skip to content

Commit 9bfe9bf

Browse files
authored
Merge pull request #2549 from sebix/fix-2548
sql output: handle empty string fields paramter
2 parents 96ebee1 + 5b6c602 commit 9bfe9bf

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@
4040
- The requirement can only be installed on Python version < 3.12.
4141
- Add a check on the Python version and exit if incompatible.
4242
- Add a deprecation warning (PR#2544 by Sebastian Wagner)
43+
- `intelmq.bots.outputs.sql.output`:
44+
- Treat an empty string `fields` parameter as unset parameter, fixing a crash in default configuration (PR#2548 by Sebastian Wagner, fixes #2548).
4345

4446
### Documentation
4547
- `docs/admin/installation/linux-packages`: Add `[signed-by=]` options, add wget command as alternative to curl (PR#2547 by Sebastian Wagner).

intelmq/bots/outputs/sql/output.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,7 @@ def init(self):
4343
def process(self):
4444
event = self.receive_message().to_dict(jsondict_as_string=self.jsondict_as_string)
4545

46-
key_names = self.fields
47-
if key_names is None:
48-
key_names = event.keys()
46+
key_names = self.fields or event.keys()
4947
valid_keys = [key for key in key_names if key in event]
5048
keys = '", "'.join(valid_keys)
5149
values = self.prepare_values(itemgetter_tuple(*valid_keys)(event))

0 commit comments

Comments
 (0)