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

BaseSingleItemSelector.preHandler returns null instead of this #593

Closed
peterdb opened this issue Dec 26, 2022 · 1 comment
Closed

BaseSingleItemSelector.preHandler returns null instead of this #593

peterdb opened this issue Dec 26, 2022 · 1 comment
Assignees
Labels
branch/2.1.x Issue for a branch for/backport For backporting type/bug Is a bug report
Milestone

Comments

@peterdb
Copy link

peterdb commented Dec 26, 2022

This results in this error when using preHandler in a ComponentFlow using the builder:
java.lang.NullPointerException: Cannot invoke "org.springframework.shell.component.flow.SingleItemSelectorSpec.next(java.util.function.Function)" because the return value of "org.springframework.shell.component.flow.SingleItemSelectorSpec.preHandler(java.util.function.Consumer)" is null

Looks like a typo to me:

@Override public SingleItemSelectorSpec preHandler(Consumer<SingleItemSelectorContext<String, SelectorItem<String>>> handler) { this.preHandlers.add(handler); return null; }

@jvalkeal jvalkeal self-assigned this Jan 1, 2023
@jvalkeal jvalkeal added the type/bug Is a bug report label Jan 1, 2023
@jvalkeal
Copy link
Contributor

jvalkeal commented Jan 1, 2023

Thx a lot for reporting, yes it is a dump typo.

@jvalkeal jvalkeal added this to the 3.0.0-RC1 milestone Jan 1, 2023
@jvalkeal jvalkeal added for/backport For backporting branch/2.1.x Issue for a branch labels Jan 1, 2023
jvalkeal added a commit that referenced this issue Jan 1, 2023
- Backport #593
- Fixes #598
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
branch/2.1.x Issue for a branch for/backport For backporting type/bug Is a bug report
Projects
None yet
Development

No branches or pull requests

2 participants