Skip to content
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

Add NPE checks on Object.values() calls #595

Merged
merged 1 commit into from
Feb 3, 2025

Conversation

ohltyler
Copy link
Member

@ohltyler ohltyler commented Feb 3, 2025

Description

There are certain edge cases where the values called in Object.values() may be undefined or null, which crashes the webpage. This adds checks on all instances of Object.values() with a default value if the value is undefined/null.

There is an edge case of no workflows created (no system index) that leads to server-side error, which is incorrectly setting the redux store value of workflows to undefined, and causing a crash when trying to create a workflow, where QuickConfigureModal does a validation check on the workflow names, which is where an NPE can occur. This fixes that by auditing all instances of Object.values().

Check List

  • Commits are signed per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Signed-off-by: Tyler Ohlsen <ohltyler@amazon.com>
@saimedhi saimedhi merged commit 2a61016 into opensearch-project:main Feb 3, 2025
10 checks passed
opensearch-trigger-bot bot pushed a commit that referenced this pull request Feb 3, 2025
Signed-off-by: Tyler Ohlsen <ohltyler@amazon.com>
(cherry picked from commit 2a61016)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
opensearch-trigger-bot bot pushed a commit that referenced this pull request Feb 3, 2025
Signed-off-by: Tyler Ohlsen <ohltyler@amazon.com>
(cherry picked from commit 2a61016)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
@ohltyler ohltyler deleted the npe-fix branch February 3, 2025 17:55
ohltyler pushed a commit that referenced this pull request Feb 3, 2025
(cherry picked from commit 2a61016)

Signed-off-by: Tyler Ohlsen <ohltyler@amazon.com>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
ohltyler pushed a commit that referenced this pull request Feb 3, 2025
(cherry picked from commit 2a61016)

Signed-off-by: Tyler Ohlsen <ohltyler@amazon.com>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants