From 672f7959478181bfe3dd5138acc5e9445dc7846c Mon Sep 17 00:00:00 2001 From: Yanhui Li Date: Sat, 13 Jan 2024 10:02:11 +1100 Subject: [PATCH] Ignore the "Project-level session is not set" error when closing project --- src/org/intellij/sequencer/SequencePlugin2.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/org/intellij/sequencer/SequencePlugin2.java b/src/org/intellij/sequencer/SequencePlugin2.java index f6e160cc..ad2dc886 100644 --- a/src/org/intellij/sequencer/SequencePlugin2.java +++ b/src/org/intellij/sequencer/SequencePlugin2.java @@ -82,10 +82,15 @@ public static SequencePlugin2 getInstance(Project project) { } public void projectClosed() { - try{ + try { getToolWindowManager().unregisterToolWindow(PLAGIN_NAME); } catch (AlreadyDisposedException e) { - + //ignore + } catch (IllegalStateException e) { + if (!e.getMessage().startsWith("Project-level session is not set")) { + throw e; + } + //else ignore } }