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
Avoid NullPointerException when customChange has no "class" attribute #1648
Avoid NullPointerException when customChange has no "class" attribute #1648
Conversation
90f64ad
to
c95798b
Compare
Thanks @danielthegray for fixing this issue. Always appreciated when our core team helps fix issues. |
32c3961
to
c95798b
Compare
a030f39
to
77ec354
Compare
…s://github.com/danielthegray/liquibase into danielthegray-improve-missing-class-name-custom-change-error # Conflicts: # liquibase-core/src/test/groovy/liquibase/change/custom/CustomChangeWrapperTest.groovy
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.
The changes look good, thanks!
…ve-missing-class-name-custom-change-error
Verify update shows correct error message when class attribute is not specified. PASS
Verify update is successful when class attribute is specified. PASS Liquibase version [Core: //improve-missing-class-name-custom-change-error/1452/fc0771/2022-02-09 21:38+0000, Pro: master/591/f653ec/2022-02-09T18:09:13Z] #1452 |
Environment
Liquibase Version: all
Liquibase Integration & Version: all
Liquibase Extension(s) & Version: all
Database Vendor & Version: all
Operating System Type & Version: all
Pull Request Type
Description
If a customChange node is missing the "class" attribute (either by typo, or mis-indentation) a NullPointerException is thrown:
Steps To Reproduce
Create a customChange node with no class attribute, and you will see this exception.
Actual Behavior
Check description.
Expected/Desired Behavior
A nicer exception should appear with a better error message.
Fast Track PR Acceptance Checklist:
Need Help?
Come chat with us on our discord channel
Dev Handoff Notes (Internal Use)
Links
Testing
Dev Verification
Code review and ensured new automated test is good
Manual Tests
Verify update shows correct error message when class attribute is not specified.
create a changelog with customChange changeset, but do not specify class attribute
liquibase --log-level INFO update --changelog-file changelog.yaml
Custom change node has no 'class' attribute!
error message is shownVerify update is successful when class attribute is specified.
specify 'class' attribute in your changelog
liquibase update --changelog-file changelog.yaml
update is successful
┆Issue is synchronized with this Jira Bug by Unito