fix npe if nothing is selected

dbus-notify
Zlatin Balevsky 2022-05-04 18:17:35 +01:00
parent fef73f14ab
commit 3efee7ef68
No known key found for this signature in database
GPG Key ID: A72832072D525E41
1 changed files with 1 additions and 1 deletions

View File

@ -1496,7 +1496,7 @@ class MainFrameView {
if (model.treeVisible) { if (model.treeVisible) {
def sharedFilesTree = builder.getVariable("shared-files-tree") def sharedFilesTree = builder.getVariable("shared-files-tree")
TreePath[] selected = sharedFilesTree.getSelectionPaths() TreePath[] selected = sharedFilesTree.getSelectionPaths()
if (selected.length != 1) if (selected == null || selected.length != 1)
return null return null
Object o = selected[0].getLastPathComponent().getUserObject() Object o = selected[0].getLastPathComponent().getUserObject()
if (o instanceof SharedFile) if (o instanceof SharedFile)