Skip to content

fix: Add default values to uninitialized typed properties in Response class#81

Merged
GeraudBourdin merged 1 commit intopartITech:mainfrom
petarbasic:fix/response-uninitialized-properties
Feb 5, 2026
Merged

fix: Add default values to uninitialized typed properties in Response class#81
GeraudBourdin merged 1 commit intopartITech:mainfrom
petarbasic:fix/response-uninitialized-properties

Conversation

@petarbasic
Copy link
Copy Markdown
Contributor

Properties like $created, $model, $fingerPrint, and $pages were declared without defaults, causing "must not be accessed before initialization" errors when accessing fields not present in certain API response types.

For example:

  • $pages is only in OCR responses → errors on chat
  • $created is not in OCR responses → errors on OCR

Fixes #80

… class

Properties like $created, $model, $fingerPrint, and $pages were declared
without defaults, causing 'must not be accessed before initialization' errors
when accessing fields not present in certain API response types (e.g. $pages
is only in OCR responses, $created is not in OCR responses).

Fixes partITech#80
@GeraudBourdin GeraudBourdin merged commit 0240eef into partITech:main Feb 5, 2026
@GeraudBourdin
Copy link
Copy Markdown
Collaborator

Thanks a lot !

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.

Response class: typed properties without defaults cause initialization errors

2 participants