Skip to content

Potential null pointer exception when reading primitive values#1352

Merged
fjtirado merged 1 commit intoserverlessworkflow:mainfrom
fjtirado:marshalling_utils_fix
Apr 29, 2026
Merged

Potential null pointer exception when reading primitive values#1352
fjtirado merged 1 commit intoserverlessworkflow:mainfrom
fjtirado:marshalling_utils_fix

Conversation

@fjtirado
Copy link
Copy Markdown
Collaborator

Fixing null pointer exception when reading primitive if bytes is null

Copilot AI review requested due to automatic review settings April 29, 2026 10:29
@fjtirado fjtirado force-pushed the marshalling_utils_fix branch from 2b26972 to c6194ba Compare April 29, 2026 10:29
Signed-off-by: fjtirado <ftirados@redhat.com>
@fjtirado fjtirado force-pushed the marshalling_utils_fix branch from c6194ba to fcd588a Compare April 29, 2026 10:32
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses a null-pointer exception risk when unmarshalling primitive values from a byte[] by introducing explicit default handling when the input byte array is null.

Changes:

  • Added writeInt / readInt helpers to MarshallingUtils.
  • Updated primitive readers (readBoolean, readShort, readInt) to return default primitive values when value == null.
  • Refactored readValue to support an optional defaultValue for null inputs.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@fjtirado fjtirado merged commit b6c7557 into serverlessworkflow:main Apr 29, 2026
3 checks passed
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.

2 participants