diff --git a/Core/src/org/sleuthkit/autopsy/modules/hashdatabase/HashDatabaseOptionsPanelController.java b/Core/src/org/sleuthkit/autopsy/modules/hashdatabase/HashDatabaseOptionsPanelController.java index 41de451c67..4d15c43bd1 100644 --- a/Core/src/org/sleuthkit/autopsy/modules/hashdatabase/HashDatabaseOptionsPanelController.java +++ b/Core/src/org/sleuthkit/autopsy/modules/hashdatabase/HashDatabaseOptionsPanelController.java @@ -72,7 +72,10 @@ public final class HashDatabaseOptionsPanelController extends OptionsPanelContro */ @Override public void cancel() { - getPanel().cancel(); + if(changed) { + getPanel().cancel(); + changed = false; + } } @Override diff --git a/Core/src/org/sleuthkit/autopsy/modules/hashdatabase/HashDbManager.java b/Core/src/org/sleuthkit/autopsy/modules/hashdatabase/HashDbManager.java index 139edb8ec7..40544c5485 100644 --- a/Core/src/org/sleuthkit/autopsy/modules/hashdatabase/HashDbManager.java +++ b/Core/src/org/sleuthkit/autopsy/modules/hashdatabase/HashDbManager.java @@ -326,17 +326,19 @@ public class HashDbManager implements PropertyChangeListener { } // Add the hash database to the collection - hashSets.add(db); - - // Let any external listeners know that there's a new set - try { - changeSupport.firePropertyChange(SetEvt.DB_ADDED.toString(), null, hashSetName); - } catch (Exception e) { - logger.log(Level.SEVERE, "HashDbManager listener threw exception", e); //NON-NLS - MessageNotifyUtil.Notify.show( - NbBundle.getMessage(this.getClass(), "HashDbManager.moduleErr"), - NbBundle.getMessage(this.getClass(), "HashDbManager.moduleErrorListeningToUpdatesMsg"), - MessageNotifyUtil.MessageType.ERROR); + if(!hashSets.contains(db)) { + hashSets.add(db); + + // Let any external listeners know that there's a new set + try { + changeSupport.firePropertyChange(SetEvt.DB_ADDED.toString(), null, hashSetName); + } catch (Exception e) { + logger.log(Level.SEVERE, "HashDbManager listener threw exception", e); //NON-NLS + MessageNotifyUtil.Notify.show( + NbBundle.getMessage(this.getClass(), "HashDbManager.moduleErr"), + NbBundle.getMessage(this.getClass(), "HashDbManager.moduleErrorListeningToUpdatesMsg"), + MessageNotifyUtil.MessageType.ERROR); + } } return db;