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

NPE in TableColumn.cellValueFactory_= #371

Closed
s-bernard opened this issue Dec 21, 2021 · 2 comments · Fixed by #372
Closed

NPE in TableColumn.cellValueFactory_= #371

s-bernard opened this issue Dec 21, 2021 · 2 comments · Fixed by #372
Labels
Milestone

Comments

@s-bernard
Copy link
Contributor

In:


if f(v) return null, we get a NPE. However, it is a totally acceptable value for javafx to return null here.

Suggested fix, replace line 320 by Option(f(v)).map(_.delegate).getOrElse(null).

Maybe a future solution would be to change f to be f: TableColumn.CellDataFeatures[S, T] => Option[ObservableValue[T, T]] to limit the number of Option wrapping as discussed in #370.

@jpsacha
Copy link
Member

jpsacha commented Dec 22, 2021

@s-bernard can you create a PR with the suggested fix?
Option(f(v)).map(_.delegate).getOrElse(null)

Looks that this needs to be done for TableColumn and TreeTableColumn

Let's keep the signature for f as it is for now

@jpsacha jpsacha added this to the 17.0.1-R27 milestone Dec 22, 2021
@s-bernard
Copy link
Contributor Author

Yes, OK

s-bernard added a commit to s-bernard/scalafx that referenced this issue Dec 28, 2021
@jpsacha jpsacha added the bug label May 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants