Skip to content

fix(QTDI-2954): fix possible NPE in VaultClient#1230

Open
undx wants to merge 4 commits into
masterfrom
ouf/QTDI-2954-guard-npe
Open

fix(QTDI-2954): fix possible NPE in VaultClient#1230
undx wants to merge 4 commits into
masterfrom
ouf/QTDI-2954-guard-npe

Conversation

@undx
Copy link
Copy Markdown
Member

@undx undx commented May 28, 2026

https://qlik-dev.atlassian.net/browse/QTDI-2954

Requirements

  • Any code change adding any logic MUST be tested through a unit test executed with the default build
  • Any API addition MUST be done with a documentation update if relevant

Why this PR is needed?

What does this PR adds (design/code thoughts)?

AI generated code

https://internal.qlik.dev/general/ways-of-working/code-reviews/#guidelines-for-ai-generated-code

  • this PR has been written with the help of GitHub Copilot or another generative AI tool

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 possible null response handling issue in VaultClient.throwError(Throwable) by preserving the configured fallback status when a WebApplicationException has no Response.

Changes:

  • Moves response.getStatus() inside the existing null check in throwError(Throwable).
  • Adds a unit test that invokes throwError(Throwable) with a WebApplicationException whose response is null.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
vault-client/src/main/java/org/talend/sdk/components/vault/client/VaultClient.java Makes throwError(Throwable) avoid dereferencing a null JAX-RS response.
vault-client/src/test/java/org/talend/sdk/components/vault/client/VaultClientTest.java Adds regression coverage for null response handling in throwError(Throwable).

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

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

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

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

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
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

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

@sonar-rnd
Copy link
Copy Markdown

sonar-rnd Bot commented May 28, 2026

Failed Quality Gate failed

  • 0.00% Coverage on New Code (is less than 80.00%)
  • 4 New Issues (is greater than 0)

Project ID: org.talend.sdk.component:component-runtime

View in SonarQube

@undx undx requested a review from ozhelezniak-talend May 28, 2026 14:37
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