4700 Correctly set curent case to null when case is closed

This commit is contained in:
Richard Cordovano 2021-04-01 11:23:39 -04:00
parent 9248c9dd7e
commit f135aa8f87

View File

@ -440,45 +440,38 @@ public class Case {
*/
OS_ACCOUNT_ADDED,
/**
* OSAccount associated with the current case has changed.
* Call getOsAccount to get the changed account;
* OSAccount associated with the current case has changed. Call
* getOsAccount to get the changed account;
*/
OS_ACCOUNT_CHANGED,
/**
* OSAccount associated with the current case has been deleted.
*/
OS_ACCOUNT_REMOVED,
/**
* Hosts associated with the current case added.
*/
HOSTS_ADDED,
/**
* Hosts associated with the current case has changed.
*/
HOSTS_CHANGED,
/**
* Hosts associated with the current case has been deleted.
*/
HOSTS_DELETED,
/**
* Persons associated with the current case added.
*/
PERSONS_ADDED,
/**
* Persons associated with the current case has changed.
*/
PERSONS_CHANGED,
/**
* Persons associated with the current case has been deleted.
*/
PERSONS_DELETED
;
PERSONS_DELETED;
};
/**
@ -514,21 +507,21 @@ public class Case {
@Subscribe
public void publishOsAccountAddedEvent(OsAccountsCreationEvent event) {
for(OsAccount account: event.getOsAcounts()) {
for (OsAccount account : event.getOsAcounts()) {
eventPublisher.publish(new OsAccountAddedEvent(account));
}
}
@Subscribe
public void publishOsAccountChangedEvent(OsAccountsUpdateEvent event) {
for(OsAccount account: event.getOsAcounts()) {
for (OsAccount account : event.getOsAcounts()) {
eventPublisher.publish(new OsAccountChangedEvent(account));
}
}
@Subscribe
public void publishOsAccountDeletedEvent(OsAccountsDeleteEvent event) {
for(Long accountId: event.getOsAcountObjectIds()) {
for (Long accountId : event.getOsAcountObjectIds()) {
eventPublisher.publish(new OsAccountRemovedEvent(accountId));
}
}
@ -882,12 +875,12 @@ public class Case {
eventPublisher.publishLocally(new AutopsyEvent(Events.CURRENT_CASE.toString(), closedCase, null));
logger.log(Level.INFO, "Closing current case {0} ({1}) in {2}", new Object[]{closedCase.getDisplayName(), closedCase.getName(), closedCase.getCaseDirectory()}); //NON-NLS
closedCase.doCloseCaseAction();
currentCase = null;
logger.log(Level.INFO, "Closed current case {0} ({1}) in {2}", new Object[]{closedCase.getDisplayName(), closedCase.getName(), closedCase.getCaseDirectory()}); //NON-NLS
} catch (CaseActionException ex) {
logger.log(Level.SEVERE, String.format("Error closing current case %s (%s) in %s", closedCase.getDisplayName(), closedCase.getName(), closedCase.getCaseDirectory()), ex); //NON-NLS
throw ex;
} finally {
currentCase = null;
if (RuntimeProperties.runningWithGUI()) {
updateGUIForCaseClosed();
}
@ -1808,6 +1801,7 @@ public class Case {
/**
* Notify via an autopsy event that a host has been added.
*
* @param host The host that has been added.
*/
public void notifyHostAdded(Host host) {
@ -1816,6 +1810,7 @@ public class Case {
/**
* Notify via an autopsy event that a host has been changed.
*
* @param newValue The host that has been updated.
*/
public void notifyHostChanged(Host newValue) {
@ -1824,6 +1819,7 @@ public class Case {
/**
* Notify via an autopsy event that a host has been deleted.
*
* @param host The host that has been deleted.
*/
public void notifyHostDeleted(Host host) {
@ -1832,6 +1828,7 @@ public class Case {
/**
* Notify via an autopsy event that a person has been added.
*
* @param person The person that has been added.
*/
public void notifyPersonAdded(Person person) {
@ -1840,6 +1837,7 @@ public class Case {
/**
* Notify via an autopsy event that a person has been changed.
*
* @param newValue The person that has been updated.
*/
public void notifyPersonChanged(Person newValue) {
@ -1848,6 +1846,7 @@ public class Case {
/**
* Notify via an autopsy event that a person has been deleted.
*
* @param person The person that has been deleted.
*/
public void notifyPersonDeleted(Person person) {