check for null

This commit is contained in:
Brian Carrier 2018-10-22 12:03:01 -04:00
parent 5035b7074f
commit 8ef79eb5ae

View File

@ -530,16 +530,19 @@ public class GroupManager {
// NOTE: We assume that it has already been determined that GroupKey can be displayed based on Data Source filters // NOTE: We assume that it has already been determined that GroupKey can be displayed based on Data Source filters
if (group == null) { if (group == null) {
//if there wasn't already a group check if there should be one now //if there wasn't already a DrawableGroup, then check if this group is now
// path group, for example, only gets created when all files are analyzed // 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); group = popuplateIfAnalyzed(groupKey, null);
} else { } else {
//if there is aleady a group that was previously deemed fully analyzed, then add this newly analyzed file to it. //if there is aleady a group that was previously deemed fully analyzed, then add this newly analyzed file to it.
group.addFile(fileID); group.addFile(fileID);
} }
// reset the seen status for the group // reset the seen status for the group
if (group != null) {
markGroupSeen(group, false); markGroupSeen(group, false);
} }
}
@Subscribe @Subscribe
synchronized public void handleTagDeleted(ContentTagDeletedEvent evt) { synchronized public void handleTagDeleted(ContentTagDeletedEvent evt) {
@ -607,6 +610,8 @@ public class GroupManager {
* If the group is analyzed (or other criteria based on grouping) and should * 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 * be shown to the user, then add it to the appropriate data structures so
* that it can be viewed. * that it can be viewed.
*
* @returns null if Group is not ready to be viewed
*/ */
synchronized private DrawableGroup popuplateIfAnalyzed(GroupKey<?> groupKey, ReGroupTask<?> task) { synchronized private DrawableGroup popuplateIfAnalyzed(GroupKey<?> groupKey, ReGroupTask<?> task) {
/* /*