diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/CollaborationMonitor.java b/Core/src/org/sleuthkit/autopsy/casemodule/CollaborationMonitor.java index 5758d5d8b5..f99a643900 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/CollaborationMonitor.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/CollaborationMonitor.java @@ -46,6 +46,7 @@ import org.sleuthkit.autopsy.events.AutopsyEventPublisher; import org.sleuthkit.autopsy.ingest.IngestManager; import org.sleuthkit.autopsy.ingest.events.DataSourceAnalysisCompletedEvent; import org.sleuthkit.autopsy.ingest.events.DataSourceAnalysisStartedEvent; +import org.sleuthkit.datamodel.Content; /** * A collaboration monitor listens to local events and translates them into @@ -231,9 +232,12 @@ final class CollaborationMonitor { * @param event A data source analysis started event. */ synchronized void addDataSourceAnalysisTask(DataSourceAnalysisStartedEvent event) { - String status = NbBundle.getMessage(CollaborationMonitor.class, "CollaborationMonitor.analyzingDataSourceStatus.msg", hostName, event.getDataSource().getName()); - jobIdsTodataSourceAnalysisTasks.put(event.getDataSourceIngestJobId(), new Task(++nextTaskId, status)); - eventPublisher.publishRemotely(new CollaborationEvent(hostName, getCurrentTasks())); + Content dataSource = event.getDataSource(); + if (dataSource != null) { + String status = NbBundle.getMessage(CollaborationMonitor.class, "CollaborationMonitor.analyzingDataSourceStatus.msg", hostName, dataSource.getName()); + jobIdsTodataSourceAnalysisTasks.put(event.getDataSourceIngestJobId(), new Task(++nextTaskId, status)); + eventPublisher.publishRemotely(new CollaborationEvent(hostName, getCurrentTasks())); + } } /** diff --git a/Core/src/org/sleuthkit/autopsy/timeline/ui/ViewFrame.java b/Core/src/org/sleuthkit/autopsy/timeline/ui/ViewFrame.java index a6a2006f04..837398c447 100644 --- a/Core/src/org/sleuthkit/autopsy/timeline/ui/ViewFrame.java +++ b/Core/src/org/sleuthkit/autopsy/timeline/ui/ViewFrame.java @@ -96,6 +96,7 @@ import org.sleuthkit.autopsy.timeline.ui.detailview.DetailViewPane; import org.sleuthkit.autopsy.timeline.ui.detailview.tree.EventsTree; import org.sleuthkit.autopsy.timeline.ui.listvew.ListViewPane; import org.sleuthkit.autopsy.timeline.utils.RangeDivisionInfo; +import org.sleuthkit.datamodel.Content; /** * A container for an AbstractTimelineView. Has a Toolbar on top to hold @@ -349,8 +350,8 @@ final public class ViewFrame extends BorderPane { viewModeToggleGroup.add(detailsToggle, ViewMode.DETAIL); viewModeToggleGroup.add(countsToggle, ViewMode.COUNTS); modeSegButton.setToggleGroup(viewModeToggleGroup); - viewModeToggleGroup.valueProperty().addListener((observable, oldViewMode, newViewVode) -> - controller.setViewMode(newViewVode != null ? newViewVode : (oldViewMode != null ? oldViewMode : ViewMode.COUNTS)) + viewModeToggleGroup.valueProperty().addListener((observable, oldViewMode, newViewVode) + -> controller.setViewMode(newViewVode != null ? newViewVode : (oldViewMode != null ? oldViewMode : ViewMode.COUNTS)) ); controller.viewModeProperty().addListener(viewMode -> syncViewMode()); @@ -501,8 +502,11 @@ final public class ViewFrame extends BorderPane { "ViewFrame.notification.analysisComplete=Analysis has finished for {0}. The Timeline DB may be out of date."}) public void handleAnalysisCompleted(DataSourceAnalysisCompletedEvent event) { Platform.runLater(() -> { - notificationPane.getActions().setAll(new UpdateDB(controller)); - notificationPane.show(Bundle.ViewFrame_notification_analysisComplete(event.getDataSource().getName()), new ImageView(WARNING)); + Content dataSource = event.getDataSource(); + if (dataSource != null) { + notificationPane.getActions().setAll(new UpdateDB(controller)); + notificationPane.show(Bundle.ViewFrame_notification_analysisComplete(dataSource.getName()), new ImageView(WARNING)); + } }); } diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryModule.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryModule.java index 9db57c336c..3c89a3b3fb 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryModule.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryModule.java @@ -199,7 +199,7 @@ public class ImageGalleryModule { if (currentController.isListeningEnabled() == false) { return; } - + String eventType = event.getPropertyName(); switch (IngestManager.IngestModuleEvent.valueOf(eventType)) { case FILE_DONE: @@ -354,6 +354,11 @@ public class ImageGalleryModule { DataSourceAnalysisEvent dataSourceEvent = (DataSourceAnalysisEvent) event; Content dataSource = dataSourceEvent.getDataSource(); + if (dataSource == null) { + logger.log(Level.SEVERE, String.format("Failed to handle %s event", event.getPropertyName())); //NON-NLS + return; + } + long dataSourceObjId = dataSource.getId(); String eventType = dataSourceEvent.getPropertyName(); try {