RFR: 8279640: ListView with null SelectionModel/FocusModel throws NPE [v5]

Marius Hanl mhanl at openjdk.org
Tue Sep 13 13:03:51 UTC 2022


On Tue, 13 Sep 2022 12:16:28 GMT, Thiago Milczarek Sayao <tsayao at openjdk.org> wrote:

> Just updated to JavaFX 19 (without this fix) and noticed this NPE:
> 
> Exception in thread "JavaFX Application Thread" java.lang.NullPointerException: Cannot invoke "javafx.scene.control.TableView$TableViewSelectionModel.getSelectedCells()" because the return value of "javafx.scene.control.TableView.getSelectionModel()" is null
> 
> This is when setting SelectionModel to null (because I don't want the TableView to be selectable) and clicking on the headerbar to sort.

This PR is only touching the `ListView`, not the `TableView`.
The behaviour you mentioned is fixed in another PR: https://github.com/openjdk/jfx/pull/876

-------------

PR: https://git.openjdk.org/jfx/pull/711


More information about the openjfx-dev mailing list