File tree Expand file tree Collapse file tree 1 file changed +18
-15
lines changed
adapter/src/main/kotlin/org/javacs/ktda/jdi Expand file tree Collapse file tree 1 file changed +18
-15
lines changed Original file line number Diff line number Diff line change @@ -167,19 +167,22 @@ class JDIDebuggee(
167
167
override fun positionOf (location : Location ): Position ? = sourceOf(location)
168
168
?.let { Position (it, location.lineNumber()) }
169
169
170
- private fun sourceOf (location : Location ): Source ? {
171
- val sourcePath = location.sourcePath()
172
- val sourceName = location.sourceName()
173
-
174
- return sourcesRoots
175
- .asSequence()
176
- .map { it.resolve(sourcePath) }
177
- .orEmpty()
178
- .mapNotNull { findValidKtFilePath(it, sourceName) }
179
- .firstOrNull()
180
- ?.let { Source (
181
- name = sourceName ? : it.fileName.toString(),
182
- filePath = it
183
- ) }
184
- }
170
+ private fun sourceOf (location : Location ): Source ? =
171
+ try {
172
+ val sourcePath = location.sourcePath()
173
+ val sourceName = location.sourceName()
174
+
175
+ sourcesRoots
176
+ .asSequence()
177
+ .map { it.resolve(sourcePath) }
178
+ .orEmpty()
179
+ .mapNotNull { findValidKtFilePath(it, sourceName) }
180
+ .firstOrNull()
181
+ ?.let { Source (
182
+ name = sourceName ? : it.fileName.toString(),
183
+ filePath = it
184
+ ) }
185
+ } catch (exception: AbsentInformationException ) {
186
+ null
187
+ }
185
188
}
You can’t perform that action at this time.
0 commit comments