Skip to content

Commit 3a059d2

Browse files
authored
Fix IncorrectOperationException on close UTBotInspectionContext (#1483)
1 parent b9baaaf commit 3a059d2

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
@file:Suppress("UnstableApiUsage")
2+
13
package org.utbot.intellij.plugin.inspection
24

35
import com.intellij.codeInspection.ex.*
@@ -41,6 +43,9 @@ class UnitTestBotInspectionContext(
4143
}
4244

4345
override fun close(noSuspiciousCodeFound: Boolean) {
46+
if (!noSuspiciousCodeFound && (view == null || view.isRerun)) {
47+
return
48+
}
4449
myPresentationMap.clear()
4550
super.close(noSuspiciousCodeFound)
4651
}

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
@file:Suppress("UnstableApiUsage")
2+
13
package org.utbot.intellij.plugin.inspection
24

35
import com.intellij.codeInspection.ex.GlobalInspectionContextImpl

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
@file:Suppress("UnstableApiUsage")
2+
13
package org.utbot.intellij.plugin.inspection
24

35
import com.intellij.codeInspection.CommonProblemDescriptor

0 commit comments

Comments
 (0)