Skip to content

Commit e358e0a

Browse files
committed
Wrap file reading with try/catch
1 parent ff827eb commit e358e0a

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

utbot-intellij/src/main/kotlin/org/utbot/intellij/plugin/ui/GenerateTestsDialogWindow.kt

+7-2
Original file line numberDiff line numberDiff line change
@@ -1033,8 +1033,13 @@ class GenerateTestsDialogWindow(val model: GenerateTestsModel) : DialogWrapper(m
10331033
val mockMakerPath = "$entryPath/$MOCKITO_EXTENSIONS_FOLDER/$MOCKITO_MOCKMAKER_FILE_NAME".toPath()
10341034
if (!Files.exists(mockMakerPath)) return false
10351035

1036-
val fileLines = Files.readAllLines(mockMakerPath)
1037-
fileLines.singleOrNull() == MOCKITO_EXTENSIONS_FILE_CONTENT
1036+
try {
1037+
val fileLines = Files.readAllLines(mockMakerPath)
1038+
fileLines.singleOrNull() == MOCKITO_EXTENSIONS_FILE_CONTENT
1039+
} catch (e: java.io.IOException) {
1040+
return false
1041+
}
1042+
10381043
}
10391044
}
10401045
}

0 commit comments

Comments
 (0)