3752 minor adjustment to ViewContextAction

This commit is contained in:
William Schaefer 2018-04-23 16:58:05 -04:00
parent ba0379b7f1
commit c2bc250d60

View File

@ -59,7 +59,7 @@ public class ViewContextAction extends AbstractAction {
private static final long serialVersionUID = 1L;
private static final Logger logger = Logger.getLogger(ViewContextAction.class.getName());
private Content content;
private final Content content;
/**
* An action that displays the context for the source content of an artifact
@ -72,8 +72,9 @@ public class ViewContextAction extends AbstractAction {
*/
public ViewContextAction(String displayName, BlackboardArtifactNode artifactNode) {
super(displayName);
this.content = artifactNode.getLookup().lookup(AbstractFile.class);
if (this.content != null) {
Content fileContent = artifactNode.getLookup().lookup(AbstractFile.class);
if (fileContent != null) {
this.content = fileContent;
AbstractFile file = (AbstractFile) content;
if ((TskData.FileKnown.KNOWN == file.getKnown() && UserPreferences.hideKnownFilesInDataSourcesTree())
|| (TskData.TSK_DB_FILES_TYPE_ENUM.SLACK == file.getType() && UserPreferences.hideSlackFilesInDataSourcesTree())) {