-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
null pointer issue if change changelog object is null #2837
Conversation
This will throw null pointer if change changelog object is null. this object can be null if we got below issue in the code. "Error executing SQL SELECT COUNT(*) FROM DATABASECHANGELOG: ORA-00942: table or view does not exist"
Update ChangeSet.java
Hi @kataggart , when these changes will be reviewed? |
@kamalnigam US is on holiday through Monday. I will raise it in our team stand up on Tuesday. Sorry I can't give you a more firm estimate regarding exactly when the PR will be reviewed. Thanks. |
… kamalnigam-master
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the fix. The change makes sense, and I added a unit test (and did some minor code reformatting), but I'm not sure how to configure a system to hit the problem. Even from the forum post I could pick out specific repo steps. Could you provide some?
Notes and test results:
Things to be aware of
- Change makes sense and added a unit test, but didn't know what to manually test
Things to worry about
- Nothing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix is targeted to a specific condition where a changeset does not have a parent changelog. It is unclear what steps to follow to reproduce the issue. However, the fix prevents an NPE and Dev evaluates the change as safe.
- Unit tests added.
- No additional testing necessary.
APPROVED
Test Harness Execution
Functional Test Results
NOTE: Test failures in the functional test suite are due to mismatch in expected console output and actual console output for the checks feature. These are unrelated to the changes in this PR and can be disregarded.
This will throw null pointer if change changelog object is null.
Cannot invoke "liquibase.changelog.DatabaseChangeLog.isIncludeIgnore()" because "changeLog" is null.
Environment Production
Liquibase Version: it started in 3.7.x onward.
public boolean isInheritableIgnore() {
DatabaseChangeLog changeLog = this.getChangeLog();
return changeLog.isIncludeIgnore();
}
This method was added in 3.7.x
Following is the change list
commit 9ae2b57
Liquibase Integration & Version: Spring boot
Liquibase Extension(s) & Version: it started in 3.7.x onward.
Database Vendor & Version: Oracle
Operating System Type & Version: Windows 10
Pull Request Type
Bug fix (non-breaking change which fixes an issue.)
https://forum.liquibase.org/t/null-pointer-exception-in-liquibase-core/6838
Description
when changelog object remain null. this method through null pointer issue.
public boolean isInheritableIgnore() {
DatabaseChangeLog changeLog = this.getChangeLog();
return changeLog.isIncludeIgnore();
}
This method was added in 3.7.x
Cannot invoke "liquibase.changelog.DatabaseChangeLog.isIncludeIgnore()" because "changeLog" is null.
Steps To Reproduce
https://forum.liquibase.org/t/null-pointer-exception-in-liquibase-core/6838
Actual Behavior
Code should no throw null pointer issue
Expected/Desired Behavior
A clear and concise description of what happens in the software after this pull request.
Screenshots (if appropriate)
Additional Context
Add any other context about the problem here.
Fast Track PR Acceptance Checklist:
Need Help?
[Come chat with us in the Liquibase Forum.](https://forum.liquibase.org/t/null-pointer-exception-in-liquibase-core/6838 Yes, to discuss this.)