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

TreeTable: invoking column sort causes null pointer exception #10060

Closed
lbbishop opened this issue Apr 23, 2023 · 4 comments · Fixed by #10063
Closed

TreeTable: invoking column sort causes null pointer exception #10060

lbbishop opened this issue Apr 23, 2023 · 4 comments · Fixed by #10063
Assignees
Labels
🐞 defect Bug...Something isn't working
Milestone

Comments

@lbbishop
Copy link

lbbishop commented Apr 23, 2023

Describe the bug

Clicking a sortable column in PrimeFaces TreeTable causes NPE:

Apr 24, 2023 8:15:52 AM com.sun.faces.context.AjaxExceptionHandlerImpl handlePartialResponseError
SEVERE: java.lang.NullPointerException: Cannot invoke "org.primefaces.model.TreeNode.getRowKey()" because the return value of "org.primefaces.model.TreeNode.getParent()" is null
java.lang.NullPointerException: Cannot invoke "org.primefaces.model.TreeNode.getRowKey()" because the return value of "org.primefaces.model.TreeNode.getParent()" is null
        at org.primefaces.component.treetable.TreeTableRenderer.encodeNode(TreeTableRenderer.java:528)
        at org.primefaces.component.treetable.TreeTableRenderer.encodeNodeChildren(TreeTableRenderer.java:847)
        at org.primefaces.component.treetable.TreeTableRenderer.encodeNodeChildren(TreeTableRenderer.java:834)
        at org.primefaces.component.treetable.TreeTableRenderer.encodeTbody(TreeTableRenderer.java:514)
        at org.primefaces.component.treetable.feature.SortFeature.encode(SortFeature.java:110)
        at org.primefaces.component.treetable.TreeTableRenderer.encodeEnd(TreeTableRenderer.java:118)

Reproducer is provided.

Reproducer

primefaces-test.zip

Expected behavior

Clicking sortable column should sort nodes based on sort criteria.

PrimeFaces edition

Elite

PrimeFaces version

12.0.0

Theme

NA

JSF implementation

Mojarra

JSF version

4.0.0

Java version

17

Browser(s)

No response

@lbbishop lbbishop added ‼️ needs-triage Issue needs triaging 🐞 defect Bug...Something isn't working labels Apr 23, 2023
@melloware
Copy link
Member

Looks like it might be a Mojarra issue.

mvn clean jetty:run -Pmojarra40 FAILS

mvn clean jetty:run -Pmyfaces40 PASSES

@melloware
Copy link
Member

Even with MyFaces 4.0 its kinda slow to react but does end up sorting.

@melloware melloware removed the ‼️ needs-triage Issue needs triaging label Apr 24, 2023
@melloware
Copy link
Member

Its also strange its not happening on the Showcase because your code looks identical to the Showcase?

@lbbishop
Copy link
Author

lbbishop commented Apr 24, 2023 via email

melloware added a commit to melloware/primefaces that referenced this issue Apr 24, 2023
@melloware melloware self-assigned this Apr 24, 2023
@melloware melloware added this to the 13.0.0 milestone Apr 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 defect Bug...Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants