7167 check that content is not artifact

This commit is contained in:
William Schaefer 2021-01-11 15:39:23 -05:00
parent 45f35b30ef
commit ab008b2562
3 changed files with 4 additions and 5 deletions

View File

@ -25,6 +25,7 @@ import org.openide.util.lookup.ServiceProvider;
import org.sleuthkit.autopsy.corecomponentinterfaces.TextViewer;
import org.sleuthkit.autopsy.corecomponents.DataContentViewerUtility;
import org.sleuthkit.autopsy.datamodel.StringContent;
import org.sleuthkit.datamodel.BlackboardArtifact;
import org.sleuthkit.datamodel.Content;
/**
@ -81,7 +82,7 @@ public class StringsTextViewer implements TextViewer {
return false;
}
Content content = DataContentViewerUtility.getDefaultContent(node);
return (content != null && content.getSize() > 0);
return (content != null && !(content instanceof BlackboardArtifact) && content.getSize() > 0);
}
@Override

View File

@ -46,6 +46,7 @@ import static org.sleuthkit.autopsy.corecomponents.Bundle.*;
import org.sleuthkit.autopsy.coreutils.FileUtil;
import org.sleuthkit.autopsy.datamodel.ContentUtils;
import org.sleuthkit.autopsy.datamodel.DataConversion;
import org.sleuthkit.datamodel.BlackboardArtifact;
import org.sleuthkit.datamodel.Content;
import org.sleuthkit.datamodel.TskCoreException;
@ -606,7 +607,7 @@ public class DataContentViewerHex extends javax.swing.JPanel implements DataCont
return false;
}
Content content = DataContentViewerUtility.getDefaultContent(node);
return content != null && content.getSize() > 0;
return content != null && !(content instanceof BlackboardArtifact) && content.getSize() > 0;
}
@Override

View File

@ -32,9 +32,6 @@ public class DataContentViewerUtility {
* preferring to return any Content object other than a BlackboardArtifact
* object.
*
* This method was written with the needs of the hex and strings content
* viewers in mind - the algorithm is exactly what those viewers require.
*
* @param node A display Node object.
*
* @return If there are multiple Content objects associated with the Node,