Skip to content

fix(blau): guard against missing billing account in API response#98

Open
invoiceradar-assistant wants to merge 1 commit into
mainfrom
fix/blau-billing-account-null-guard
Open

fix(blau): guard against missing billing account in API response#98
invoiceradar-assistant wants to merge 1 commit into
mainfrom
fix/blau-billing-account-null-guard

Conversation

@invoiceradar-assistant

Copy link
Copy Markdown
Collaborator

Summary

  • Adds a null guard on billingAccountList[0] in the account extraction script
  • If the API returns an empty or missing billingAccountList, now throws a descriptive error instead of crashing with TypeError: Cannot read properties of undefined (reading '0')

Root cause

The /onload/multiple/invoiceContent endpoint can return an empty billingAccountList (e.g. for certain account states). Previously this caused an unhandled TypeError that surfaced as a confusing crash.

If billingAccountList is empty or absent, the script now throws a
descriptive error instead of crashing with a TypeError on undefined.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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