diff --git a/Core/src/org/sleuthkit/autopsy/report/ReportGenerator.java b/Core/src/org/sleuthkit/autopsy/report/ReportGenerator.java index 28a8f760bb..31cf814479 100644 --- a/Core/src/org/sleuthkit/autopsy/report/ReportGenerator.java +++ b/Core/src/org/sleuthkit/autopsy/report/ReportGenerator.java @@ -533,16 +533,19 @@ class ReportGenerator { } // Get the column headers appropriate for the artifact type. List columnHeaders = getArtifactTableColumnHeaders(type.getTypeID(), attrTypeSet); - for (ArtifactData d : artifactList) { - d.setColumnHeaders(columnHeaders); + if(columnHeaders.isEmpty()) { + continue; + } + for (ArtifactData artData : artifactList) { + artData.setColumnHeaders(columnHeaders); } // The most efficient way to sort all the Artifacts is to add them to a List, and then // sort that List based off a Comparator. Adding to a TreeMap/Set/List sorts the list // each time an element is added, which adds unnecessary overhead if we only need it sorted once. Collections.sort(artifactList); List columnHeaderNames = new ArrayList<>(); - for (Cell c : columnHeaders) { - columnHeaderNames.add(c.getColumnHeader()); + for (Cell currCell : columnHeaders) { + columnHeaderNames.add(currCell.getColumnHeader()); } for (TableReportModule module : tableModules) { @@ -1042,8 +1045,8 @@ class ReportGenerator { module.addSetElement(currentKeyword); List columnHeaders = getArtifactTableColumnHeaders(ARTIFACT_TYPE.TSK_KEYWORD_HIT.getTypeID(), new HashSet()); List columnHeaderNames = new ArrayList<>(); - for (Cell c : columnHeaders) { - columnHeaderNames.add(c.getColumnHeader()); + for (Cell currCell : columnHeaders) { + columnHeaderNames.add(currCell.getColumnHeader()); } module.startTable(columnHeaderNames); } @@ -1179,8 +1182,8 @@ class ReportGenerator { module.startSet(currentSet); List columnHeaders = getArtifactTableColumnHeaders(ARTIFACT_TYPE.TSK_HASHSET_HIT.getTypeID(), new HashSet()); List columnHeaderNames = new ArrayList<>(); - for (Cell c : columnHeaders) { - columnHeaderNames.add(c.getColumnHeader()); + for (Cell currCell : columnHeaders) { + columnHeaderNames.add(currCell.getColumnHeader()); } module.startTable(columnHeaderNames); tableProgress.get(module).updateStatusLabel( @@ -2348,7 +2351,7 @@ class ReportGenerator { public List getRow() { if (rowData == null) { try { - rowData = getOrderedRowDataAsStrings(this.columnHeaders); + rowData = getOrderedRowDataAsStrings(); // replace null values if attribute was not defined for (int i = 0; i < rowData.size(); i++) { if (rowData.get(i) == null) { @@ -2377,7 +2380,7 @@ class ReportGenerator { * * @throws TskCoreException */ - private List getOrderedRowDataAsStrings(List columnHeaders) throws TskCoreException { + private List getOrderedRowDataAsStrings() throws TskCoreException { Map mappedAttributes = getMappedAttributes(); List orderedRowData = new ArrayList<>(); if (ARTIFACT_TYPE.TSK_WEB_BOOKMARK.getTypeID() == getArtifact().getArtifactTypeID()) { @@ -2595,8 +2598,8 @@ class ReportGenerator { orderedRowData.add(mappedAttributes.get(ATTRIBUTE_TYPE.TSK_LOCAL_PATH.getTypeID())); orderedRowData.add(mappedAttributes.get(ATTRIBUTE_TYPE.TSK_REMOTE_PATH.getTypeID())); } else { - for (Cell c : columnHeaders) { - String rowData = c.getRowData(this); + for (Cell currCell : this.columnHeaders) { + String rowData = currCell.getRowData(this); orderedRowData.add(rowData); } return orderedRowData;