Skip to content

fix: handle None invoice_date and due_date in Invoice.to_dict() - #293

Open
stealthwhizz wants to merge 1 commit into
GenAI-Security-Project:mainfrom
stealthwhizz:fix/issue-290-291-invoice-none-dates
Open

fix: handle None invoice_date and due_date in Invoice.to_dict()#293
stealthwhizz wants to merge 1 commit into
GenAI-Security-Project:mainfrom
stealthwhizz:fix/issue-290-291-invoice-none-dates

Conversation

@stealthwhizz

Copy link
Copy Markdown
Contributor

Summary

  • Add None guards for invoice_date and due_date in Invoice.to_dict() to prevent AttributeError crash when either field is None
  • Follows the same pattern already used in get_vendor_payment_summary
  • Add unit tests covering None date scenarios

Fixes #290, Fixes #291

Test plan

  • test_invoice_to_dict_with_none_invoice_date — verifies no crash when invoice_date is None (PAY-FIELD-001)
  • test_invoice_to_dict_with_none_due_date — verifies no crash when due_date is None (PAY-FIELD-002)
  • test_invoice_to_dict_with_both_dates_none — edge case with both None
  • test_invoice_to_dict_with_valid_dates — regression test for normal behavior

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant