Skip to content

Commit ec17a8b

Browse files
authored
Fix closing utbot inspection context (#2018)
1 parent fde5281 commit ec17a8b

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

utbot-intellij/src/main/kotlin/org/utbot/intellij/plugin/inspection/UnitTestBotInspectionContext.kt

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,15 @@ class UnitTestBotInspectionContext(
4343
}
4444

4545
override fun close(noSuspiciousCodeFound: Boolean) {
46-
if (!noSuspiciousCodeFound && (view == null || view.isRerun)) {
47-
return
46+
try {
47+
if (!noSuspiciousCodeFound && (view == null || view.isRerun)) {
48+
return
49+
}
50+
myPresentationMap.clear()
51+
super.close(noSuspiciousCodeFound)
52+
} catch (_: Throwable) {
53+
// already closed
4854
}
49-
myPresentationMap.clear()
50-
super.close(noSuspiciousCodeFound)
5155
}
5256

5357
override fun cleanup() {

0 commit comments

Comments
 (0)