Skip to content

Commit f204c66

Browse files
committed
Fix plugin crash after processing abstract class with no implementations
1 parent ce380d2 commit f204c66

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

utbot-intellij/src/main/kotlin/org/utbot/intellij/plugin/generator/UtTestsDialogProcessor.kt

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -193,11 +193,16 @@ object UtTestsDialogProcessor {
193193
null
194194
}
195195

196-
val notEmptyCases = withUtContext(context) {
197-
testCaseGenerator
198-
.generate(methods, model.mockStrategy, model.chosenClassesToMockAlways, model.timeout)
199-
.map { it.summarize(searchDirectory) }
200-
.filterNot { it.executions.isEmpty() && it.errors.isEmpty() }
196+
val notEmptyCases = try {
197+
withUtContext(context) {
198+
testCaseGenerator
199+
.generate(methods, model.mockStrategy, model.chosenClassesToMockAlways, model.timeout)
200+
.map { it.summarize(searchDirectory) }
201+
.filterNot { it.executions.isEmpty() && it.errors.isEmpty() }
202+
}
203+
} catch (e: java.lang.IllegalStateException) {
204+
logger.error { "Test generation failed: ${e.message}" }
205+
listOf()
201206
}
202207

203208
if (notEmptyCases.isEmpty()) {

0 commit comments

Comments
 (0)