Skip to content

Update OpenAiChatModel.java #3376

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

yangjm-41
Copy link

Fix NullPointerException caused by empty choice.index() and Map.of() with null value

  • Resolve the issue where choice.index() returns an empty value, leading to a NullPointerException.
  • Ensure that Map.of() does not accept null values to prevent runtime errors.
  • Implement null checks and provide default values to handle edge cases gracefully.
  • Update unit tests to cover scenarios where choice.index() is empty or null.

Thank you for taking time to contribute this pull request!
You might have already read the [contributor guide][1], but as a reminder, please make sure to:

  • Sign the contributor license agreement
  • Rebase your changes on the latest main branch and squash your commits
  • Add/Update unit tests as needed
  • Run a build and make sure all tests pass prior to submission

Fix NullPointerException caused by empty choice.index() and Map.of() with null value

- Resolve the issue where choice.index() returns an empty value, leading to a NullPointerException.
- Ensure that Map.of() does not accept null values to prevent runtime errors.
- Implement null checks and provide default values to handle edge cases gracefully.
- Update unit tests to cover scenarios where choice.index() is empty or null.


Signed-off-by: yiangjm <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants