mirror of
https://github.com/xpipe-io/xpipe.git
synced 2024-11-22 07:30:24 +00:00
Fix NPE [release] [noannounce]
This commit is contained in:
parent
2b2614cc9b
commit
b60c3d1bba
1 changed files with 12 additions and 4 deletions
|
@ -251,10 +251,14 @@ final class FileListComp extends AnchorPane {
|
|||
var currentDirectory = fileList.getFileSystemModel().getCurrentDirectory();
|
||||
if (!Objects.equals(lastDir.get(), currentDirectory)) {
|
||||
TableViewSkin<?> skin = (TableViewSkin<?>) table.getSkin();
|
||||
VirtualFlow<?> flow = (VirtualFlow<?>) skin.getChildren().get(1);
|
||||
ScrollBar vbar = (ScrollBar) flow.getChildrenUnmodifiable().get(2);
|
||||
if (vbar.getValue() != 0.0) {
|
||||
table.scrollTo(0);
|
||||
if (skin != null) {
|
||||
VirtualFlow<?> flow =
|
||||
(VirtualFlow<?>) skin.getChildren().get(1);
|
||||
ScrollBar vbar =
|
||||
(ScrollBar) flow.getChildrenUnmodifiable().get(2);
|
||||
if (vbar.getValue() != 0.0) {
|
||||
table.scrollTo(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
lastDir.setValue(currentDirectory);
|
||||
|
@ -266,6 +270,10 @@ final class FileListComp extends AnchorPane {
|
|||
|
||||
private void borderScroll(TableView<?> tableView, DragEvent event) {
|
||||
TableViewSkin<?> skin = (TableViewSkin<?>) tableView.getSkin();
|
||||
if (skin == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
VirtualFlow<?> flow = (VirtualFlow<?>) skin.getChildren().get(1);
|
||||
ScrollBar vbar = (ScrollBar) flow.getChildrenUnmodifiable().get(2);
|
||||
|
||||
|
|
Loading…
Reference in a new issue