Skip to content

Commit 9090cd7

Browse files
committed
Wrap file reading with try/catch
1 parent 825b853 commit 9090cd7

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

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1016,8 +1016,13 @@ class GenerateTestsDialogWindow(val model: GenerateTestsModel) : DialogWrapper(m
10161016
val mockMakerPath = "$entryPath/$MOCKITO_EXTENSIONS_FOLDER/$MOCKITO_MOCKMAKER_FILE_NAME".toPath()
10171017
if (!Files.exists(mockMakerPath)) return false
10181018

1019-
val fileLines = Files.readAllLines(mockMakerPath)
1020-
fileLines.singleOrNull() == MOCKITO_EXTENSIONS_FILE_CONTENT
1019+
try {
1020+
val fileLines = Files.readAllLines(mockMakerPath)
1021+
fileLines.singleOrNull() == MOCKITO_EXTENSIONS_FILE_CONTENT
1022+
} catch (e: java.io.IOException) {
1023+
return false
1024+
}
1025+
10211026
}
10221027
}
10231028
}

0 commit comments

Comments
 (0)