Skip to content

Fix crash in _parse_card_note when eventType is null#365

Open
Titouan-Loeb wants to merge 1 commit into
pytr-org:masterfrom
Titouan-Loeb:fix-card-note-null-event-type
Open

Fix crash in _parse_card_note when eventType is null#365
Titouan-Loeb wants to merge 1 commit into
pytr-org:masterfrom
Titouan-Loeb:fix-card-note-null-event-type

Conversation

@Titouan-Loeb

Copy link
Copy Markdown

event_dict.get("eventType", "") only falls back to "" when the key is missing, not when it is present but null, which Trade Republic sends for some card events. That None then hits .startswith("card_") and raises AttributeError: 'NoneType' object has no attribute 'startswith'.

Added a regression fixture with eventType explicitly null (the existing kartenzahlung_no_eventType.json only covers the key being absent, a different case)

event_dict.get("eventType", "") only falls back to "" when the key
is missing, not when it's present but null, which Trade Republic
sends for some card events. That None then hits .startswith("card_")
and raises AttributeError.

Added a regression fixture with eventType explicitly null (existing
kartenzahlung_no_eventType.json only covers the key being absent).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant