diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/OnStart.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/OnStart.java index c3bd1588fe..b222b2bc7c 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/OnStart.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/OnStart.java @@ -22,8 +22,8 @@ import org.sleuthkit.autopsy.coreutils.Logger; /** * - * The {@link OnStart} annotation tells NetBeans to invoke this class's - * {@link OnStart#run()} method + * The {@link org.openide.modules.OnStart} annotation tells NetBeans to invoke + * this class's {@link OnStart#run()} method */ @org.openide.modules.OnStart public class OnStart implements Runnable { @@ -31,7 +31,7 @@ public class OnStart implements Runnable { static private final Logger LOGGER = Logger.getLogger(OnStart.class.getName()); /** - + * * * This method is invoked by virtue of the {@link OnStart} annotation on the * {@link ImageGalleryModule} class diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/navpanel/GroupTreeCell.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/navpanel/GroupTreeCell.java index d38916aef2..8e28fd91f7 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/navpanel/GroupTreeCell.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/navpanel/GroupTreeCell.java @@ -18,6 +18,7 @@ */ package org.sleuthkit.autopsy.imagegallery.gui.navpanel; +import java.util.Objects; import static java.util.Objects.isNull; import java.util.Optional; import javafx.application.Platform; @@ -66,11 +67,13 @@ class GroupTreeCell extends TreeCell { @Override protected synchronized void updateItem(final TreeNode tNode, boolean empty) { //if there was a previous group, remove the listener - Optional.ofNullable(getItem()) - .map(TreeNode::getGroup) - .ifPresent((DrawableGroup t) -> { - t.fileIds().removeListener(listener); - }); + if (Objects.nonNull(listener)) { + Optional.ofNullable(getItem()) + .map(TreeNode::getGroup) + .ifPresent((DrawableGroup t) -> { + t.fileIds().removeListener(listener); + }); + } super.updateItem(tNode, empty);