This commit is contained in:
Greg DiCristofaro 2022-04-01 12:32:52 -04:00
parent 4178747fb4
commit 0944fd974e
2 changed files with 15 additions and 18 deletions

View File

@ -89,7 +89,7 @@ import org.sleuthkit.autopsy.coreutils.ThreadConfined;
import org.sleuthkit.autopsy.datamodel.CreditCards; import org.sleuthkit.autopsy.datamodel.CreditCards;
import org.sleuthkit.autopsy.datamodel.accounts.BINRange; import org.sleuthkit.autopsy.datamodel.accounts.BINRange;
import org.sleuthkit.autopsy.mainui.datamodel.MainDAO; import org.sleuthkit.autopsy.mainui.datamodel.MainDAO;
import org.sleuthkit.autopsy.mainui.nodes.AnalysisResultTypeFactory.KeywordSetFactory; import org.sleuthkit.autopsy.mainui.nodes.AnalysisResultTypeFactory.KeywordSetNode;
import org.sleuthkit.autopsy.mainui.nodes.AnalysisResultTypeFactory.TreeConfigTypeNode; import org.sleuthkit.autopsy.mainui.nodes.AnalysisResultTypeFactory.TreeConfigTypeNode;
import org.sleuthkit.autopsy.mainui.nodes.ChildNodeSelectionInfo.BlackboardArtifactNodeSelectionInfo; import org.sleuthkit.autopsy.mainui.nodes.ChildNodeSelectionInfo.BlackboardArtifactNodeSelectionInfo;
import org.sleuthkit.autopsy.mainui.nodes.DataArtifactTypeFactory.CreditCardByBinParentNode; import org.sleuthkit.autopsy.mainui.nodes.DataArtifactTypeFactory.CreditCardByBinParentNode;
@ -1448,11 +1448,8 @@ public final class DirectoryTreeTopComponent extends TopComponent implements Dat
return null; return null;
} }
Node configNode = keywordRootNode.getChildren().findChild(kwh.getConfiguration()); Node configNode = keywordRootNode.getChildren().findChild(KeywordSetNode.getNodeName(kwh.getConfiguration()));
if (configNode == null if (configNode == null) {
|| configNode.getChildren() == null
|| configNode.getChildren().getNodesCount(true) == 0) {
return null; return null;
} }
@ -1470,12 +1467,12 @@ public final class DirectoryTreeTopComponent extends TopComponent implements Dat
} }
} }
if (regex != null) { //For support of regex nodes such as URLs, IPs, Phone Numbers, and Email Addrs as they are down another level if (regex != null) { //For support of regex nodes such as URLs, IPs, Phone Numbers, and Email Addrs as they are down another level
Node regexNode = toRet.getChildren().findChild(regex); Node regexNode = toRet.getChildren() == null || toRet.getChildren().getNodesCount(true) == 0
if (regexNode == null ? null
|| regexNode.getChildren() == null : toRet.getChildren().findChild(regex);
|| regexNode.getChildren().getNodesCount(true) == 0) {
if (regexNode == null) {
return null; return null;
} }
@ -1484,11 +1481,11 @@ public final class DirectoryTreeTopComponent extends TopComponent implements Dat
} }
if (keywordName != null) { if (keywordName != null) {
Node keywordNameNode = toRet.getChildren().findChild(keywordName); Node keywordNameNode = toRet.getChildren() == null || toRet.getChildren().getNodesCount(true) == 0
if (keywordNameNode == null ? null
|| keywordNameNode.getChildren() == null : toRet.getChildren().findChild(keywordName);
|| keywordNameNode.getChildren().getNodesCount(true) == 0) {
if (keywordNameNode == null) {
return null; return null;
} }

View File

@ -324,7 +324,7 @@ public class AnalysisResultTypeFactory extends AbstractAnalysisResultTreeFactory
* @param itemData The data to display. * @param itemData The data to display.
*/ */
TreeConfigTypeNode(TreeResultsDTO.TreeItemDTO<? extends AnalysisResultSearchParam> itemData) { TreeConfigTypeNode(TreeResultsDTO.TreeItemDTO<? extends AnalysisResultSearchParam> itemData) {
super(itemData.getSearchParams().getArtifactType().getTypeName() + "_SET_" + itemData.getSearchParams().getConfiguration(), super(getNodeName(itemData.getSearchParams().getArtifactType().getTypeName(), itemData.getSearchParams().getConfiguration()),
getIconPath(itemData.getSearchParams().getArtifactType()), getIconPath(itemData.getSearchParams().getArtifactType()),
itemData, itemData,
Children.LEAF, Children.LEAF,
@ -445,7 +445,7 @@ public class AnalysisResultTypeFactory extends AbstractAnalysisResultTreeFactory
* @param itemData The data to display. * @param itemData The data to display.
*/ */
public KeywordSetNode(TreeResultsDTO.TreeItemDTO<? extends KeywordListSearchParam> itemData) { public KeywordSetNode(TreeResultsDTO.TreeItemDTO<? extends KeywordListSearchParam> itemData) {
super("TSK_KEYWORD_HIT_SET_" + itemData.getSearchParams().getSetName(), super(getNodeName(itemData.getSearchParams().getSetName()),
getIconPath(itemData.getSearchParams().getArtifactType()), getIconPath(itemData.getSearchParams().getArtifactType()),
itemData, itemData,
Children.create(new KeywordSearchTermFactory(itemData.getSearchParams()), true), Children.create(new KeywordSearchTermFactory(itemData.getSearchParams()), true),