fix: handle None invoice_date and due_date in Invoice.to_dict() - #293
Open
stealthwhizz wants to merge 1 commit into
Open
fix: handle None invoice_date and due_date in Invoice.to_dict()#293stealthwhizz wants to merge 1 commit into
stealthwhizz wants to merge 1 commit into
Conversation
Add None guards for invoice_date and due_date fields in Invoice.to_dict() to prevent AttributeError when these fields are None. Fixes GenAI-Security-Project#290 and GenAI-Security-Project#291.
stealthwhizz
force-pushed
the
fix/issue-290-291-invoice-none-dates
branch
from
March 23, 2026 06:24
736d086 to
753f6ed
Compare
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
invoice_dateanddue_dateinInvoice.to_dict()to preventAttributeErrorcrash when either field isNoneget_vendor_payment_summaryFixes #290, Fixes #291
Test plan
test_invoice_to_dict_with_none_invoice_date— verifies no crash wheninvoice_dateis None (PAY-FIELD-001)test_invoice_to_dict_with_none_due_date— verifies no crash whendue_dateis None (PAY-FIELD-002)test_invoice_to_dict_with_both_dates_none— edge case with both Nonetest_invoice_to_dict_with_valid_dates— regression test for normal behavior