From c18b28f85028a51f4723fd547671f103aa3a3d12 Mon Sep 17 00:00:00 2001 From: jmillman Date: Wed, 15 Jun 2016 12:16:21 -0400 Subject: [PATCH] fix potential index out of bounds exception --- .../sleuthkit/autopsy/timeline/TimeLineTopComponent.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/timeline/TimeLineTopComponent.java b/Core/src/org/sleuthkit/autopsy/timeline/TimeLineTopComponent.java index 1ca594fa14..aca105e525 100644 --- a/Core/src/org/sleuthkit/autopsy/timeline/TimeLineTopComponent.java +++ b/Core/src/org/sleuthkit/autopsy/timeline/TimeLineTopComponent.java @@ -25,7 +25,6 @@ import java.util.logging.Level; import javafx.application.Platform; import javafx.beans.InvalidationListener; import javafx.beans.Observable; -import javafx.collections.ObservableList; import javafx.scene.Scene; import javafx.scene.control.SplitPane; import javafx.scene.control.Tab; @@ -98,7 +97,7 @@ public final class TimeLineTopComponent extends TopComponent implements Explorer private final InvalidationListener selectedEventsListener = new InvalidationListener() { @Override public void invalidated(Observable observable) { - ObservableList selectedEventIDs = controller.getSelectedEventIDs(); + List selectedEventIDs = controller.getSelectedEventIDs(); //depending on the active view mode, we either update the dataResultPanel, or update the contentViewerPanel directly. switch (controller.getViewMode()) { @@ -124,7 +123,7 @@ public final class TimeLineTopComponent extends TopComponent implements Explorer LOGGER.log(Level.SEVERE, "Selecting the event node was vetoed.", ex); // NON-NLS } //if there is only one event selected push it into content viewer. - if (selectedEventIDs.size() == 1) { + if (childArray.length == 1) { contentViewerPanel.setNode(childArray[0]); } else { contentViewerPanel.setNode(null); @@ -137,7 +136,7 @@ public final class TimeLineTopComponent extends TopComponent implements Explorer LOGGER.log(Level.SEVERE, "Failed to lookup Sleuthkit object backing a SingleEvent.", ex); // NON-NLS Platform.runLater(() -> { Notifications.create() - .owner(jFXViewPanel.getScene().getWindow()) + .owner(jFXViewPanel.getScene().getWindow()) .text(Bundle.TimelineTopComponent_selectedEventListener_errorMsg()) .showError(); });