From 8ef79eb5ae17f4a035a2817f61d19fd6d628f46c Mon Sep 17 00:00:00 2001 From: Brian Carrier Date: Mon, 22 Oct 2018 12:03:01 -0400 Subject: [PATCH] check for null --- .../imagegallery/datamodel/grouping/GroupManager.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/grouping/GroupManager.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/grouping/GroupManager.java index 263e189b7d..da3623916c 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/grouping/GroupManager.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/datamodel/grouping/GroupManager.java @@ -530,15 +530,18 @@ public class GroupManager { // NOTE: We assume that it has already been determined that GroupKey can be displayed based on Data Source filters if (group == null) { - //if there wasn't already a group check if there should be one now - // path group, for example, only gets created when all files are analyzed + //if there wasn't already a DrawableGroup, then check if this group is now + // in an appropriate state to get one made. + // Path group, for example, only gets a DrawableGroup created when all files are analyzed group = popuplateIfAnalyzed(groupKey, null); } else { //if there is aleady a group that was previously deemed fully analyzed, then add this newly analyzed file to it. group.addFile(fileID); } // reset the seen status for the group - markGroupSeen(group, false); + if (group != null) { + markGroupSeen(group, false); + } } @Subscribe @@ -607,6 +610,8 @@ public class GroupManager { * If the group is analyzed (or other criteria based on grouping) and should * be shown to the user, then add it to the appropriate data structures so * that it can be viewed. + * + * @returns null if Group is not ready to be viewed */ synchronized private DrawableGroup popuplateIfAnalyzed(GroupKey groupKey, ReGroupTask task) { /*