From 4e169433c3ac26f208150579facfdeb91243bb4c Mon Sep 17 00:00:00 2001 From: Brian Carrier Date: Tue, 18 Mar 2014 21:32:52 -0400 Subject: [PATCH] Add check before we add more rows --- .../autopsy/corecomponents/DataResultViewerTable.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Core/src/org/sleuthkit/autopsy/corecomponents/DataResultViewerTable.java b/Core/src/org/sleuthkit/autopsy/corecomponents/DataResultViewerTable.java index decef8b14e..394ebc2480 100644 --- a/Core/src/org/sleuthkit/autopsy/corecomponents/DataResultViewerTable.java +++ b/Core/src/org/sleuthkit/autopsy/corecomponents/DataResultViewerTable.java @@ -391,12 +391,21 @@ public class DataResultViewerTable extends AbstractDataResultViewer { // Populate a two-dimensional array with rows of property values for up // to maxRows children of the node passed in. private static Object[][] getRowValues(Node node, int maxRows) { - Object[][] rowValues = new Object[Math.min(maxRows, node.getChildren().getNodesCount())][]; + int numRows = Math.min(maxRows, node.getChildren().getNodesCount()); + Object[][] rowValues = new Object[numRows][]; int rowCount = 0; for (Node child : node.getChildren().getNodes()) { if (rowCount >= maxRows) { break; } + // BC: I got this once, I think it was because the table + // refreshed while we were in this method + // could be better synchronized. Or it was from + // the lazy nodes updating... Didn't have time + // to fully debug it. + if (rowCount > numRows) { + break; + } PropertySet[] propertySets = child.getPropertySets(); if (propertySets.length > 0) { Property[] properties = propertySets[0].getProperties();