mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-19 19:14:55 +00:00
bug fix
This commit is contained in:
parent
5c96ed1bbf
commit
637c4571f6
@ -31,6 +31,7 @@ import java.util.stream.Collectors;
|
|||||||
import java.util.stream.Stream;
|
import java.util.stream.Stream;
|
||||||
import org.sleuthkit.autopsy.coreutils.Logger;
|
import org.sleuthkit.autopsy.coreutils.Logger;
|
||||||
import javax.swing.AbstractAction;
|
import javax.swing.AbstractAction;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.openide.nodes.AbstractNode;
|
import org.openide.nodes.AbstractNode;
|
||||||
import org.openide.explorer.ExplorerManager;
|
import org.openide.explorer.ExplorerManager;
|
||||||
import org.openide.explorer.view.TreeView;
|
import org.openide.explorer.view.TreeView;
|
||||||
@ -276,6 +277,11 @@ public class ViewContextAction extends AbstractAction {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// if no node is found, do nothing
|
||||||
|
if (parentTreeViewNode == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Set the child selection info of the parent tree node, then select
|
* Set the child selection info of the parent tree node, then select
|
||||||
* the parent node in the tree view. The results view will retrieve
|
* the parent node in the tree view. The results view will retrieve
|
||||||
@ -377,6 +383,11 @@ public class ViewContextAction extends AbstractAction {
|
|||||||
Node dummyRootNode = new DirectoryTreeFilterNode(new AbstractNode(new RootContentChildren(contentBranch)), true);
|
Node dummyRootNode = new DirectoryTreeFilterNode(new AbstractNode(new RootContentChildren(contentBranch)), true);
|
||||||
Children ancestorChildren = dummyRootNode.getChildren();
|
Children ancestorChildren = dummyRootNode.getChildren();
|
||||||
|
|
||||||
|
// if content is the data source provided, return that.
|
||||||
|
if (ancestorChildren.getNodesCount() == 1 && StringUtils.equals(ancestorChildren.getNodeAt(0).getName(), node.getName())) {
|
||||||
|
return node;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Search the tree for the parent node. Note that this algorithm
|
* Search the tree for the parent node. Note that this algorithm
|
||||||
* simply discards "extra" ancestor nodes not shown in the tree,
|
* simply discards "extra" ancestor nodes not shown in the tree,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user