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

fix: Prevent NPE in 'ou' ownership export [DHIS2-15467] #14328

Merged
merged 4 commits into from Jun 22, 2023

Conversation

maikelarabori
Copy link
Contributor

This PR fixes an NPE that happens when the table programownershiphistory contains rows with null organisationunitid.

Two preventions were added: one at querying time, so we avoid rows without organisationunitid, and another at the code level.

A small change was also applied: in the SQL function exists I gave preference to select 1, as null is also evaluated to true. It's just another preventive change.

@maikelarabori maikelarabori added the run-api-analytics-tests Enables analytics e2e tests label Jun 22, 2023
@sonarcloud
Copy link

sonarcloud bot commented Jun 22, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

Copy link
Member

@jimgrace jimgrace left a comment

Choose a reason for hiding this comment

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

Excellent, thank you!

@maikelarabori maikelarabori merged commit 3bd5663 into master Jun 22, 2023
15 checks passed
@maikelarabori maikelarabori deleted the DHIS2-15467_2.41 branch June 22, 2023 17:29
maikelarabori added a commit that referenced this pull request Jun 23, 2023
* fix: Prevent NPE in 'ou' ownership export [DHIS2-15467]

* fix: Make constants private [DHIS2-15467]

* fix: Code formatting [DHIS2-15467]

* fix: More code formatting [DHIS2-15467]
maikelarabori added a commit that referenced this pull request Jun 23, 2023
)

* fix: Prevent NPE in 'ou' ownership export [DHIS2-15467]

* fix: Make constants private [DHIS2-15467]

* fix: Code formatting [DHIS2-15467]

* fix: More code formatting [DHIS2-15467]
maikelarabori added a commit that referenced this pull request Jun 27, 2023
)

* fix: Prevent NPE in 'ou' ownership export [DHIS2-15467]

* fix: Make constants private [DHIS2-15467]

* fix: Code formatting [DHIS2-15467]

* fix: More code formatting [DHIS2-15467]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
run-api-analytics-tests Enables analytics e2e tests
3 participants