Skip to content

MYFACES-4786: NPE "id is null" on redirect navigation with null outcome - #1148

Merged
melloware merged 1 commit into
apache:mainfrom
melloware:MYFACES-4786
Nov 30, 2026
Merged

melloware merged 1 commit into
apache:mainfrom
melloware:MYFACES-4786

Conversation

@melloware

Copy link
Copy Markdown
Contributor

Fixes MYFACES-4786

A void action method yields a null outcome, which can still match a navigation case that uses <from-action> + <if> (no <from-outcome>). When that case has <redirect/>, handleNavigation calls calculateTargetFlow() with the null outcome, which reaches FlowHandler.getFlow(ctx, "", null) and fails with NullPointerException: id is null.

A null outcome can never identify a flow, so calculateTargetFlow() now returns null early. The other flow lookups in NavigationHandlerImpl already guard against a null outcome (e.g. getNavigationCommand).

Test: NavigationHandlerImplTest gains a case with a from-action + if + redirect rule and a null outcome, using the real FlowHandlerImpl (the mock one doesn't validate its arguments). It fails with id is null without the fix.

🤖 Generated with Claude Code

A void action method yields a null outcome, which can still match a
navigation case using from-action + if. When that case is a redirect,
calculateTargetFlow() passed the null outcome to FlowHandler.getFlow(),
which rejects a null id. A null outcome can never identify a flow, so
return null early.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@tandraschko

Copy link
Copy Markdown
Member

+1 for all

@melloware
melloware merged commit 27598af into apache:main Nov 30, 2026
4 checks passed
@melloware
melloware deleted the MYFACES-4786 branch November 30, 2026 18:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants