Skip to content

Commit

Permalink
Fix passing wrong value to workspace close listener
Browse files Browse the repository at this point in the history
  • Loading branch information
Col-E committed Jun 8, 2024
1 parent b76350c commit 47ee102
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,10 @@ public Workspace getCurrent() {

@Override
public void setCurrentIgnoringConditions(Workspace workspace) {
if (current != null) {
current.close();
CollectionUtil.safeForEach(closeListeners, listener -> listener.onWorkspaceClosed(workspace),
Workspace currentWorkspace = current;
if (currentWorkspace != null) {
currentWorkspace.close();
CollectionUtil.safeForEach(closeListeners, listener -> listener.onWorkspaceClosed(currentWorkspace),
(listener, t) -> logger.error("Exception thrown when closing workspace", t));
}
current = workspace;
Expand Down

0 comments on commit 47ee102

Please sign in to comment.