Skip to content

Commit bbd56be

Browse files
authored
Merge pull request #2265 from digma-ai/make-codeLocation-nullable
make-codeLocation-nullable Closes #2264
2 parents aea6626 + 9856e98 commit bbd56be

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

ide-common/src/main/kotlin/org/digma/intellij/plugin/scope/CodeNavigationBuilder.kt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,11 @@ private fun buildCodeLocationFromAssetNavigation(
5555
assetNavigation: AssetNavigationResponse,
5656
): CodeLocation {
5757

58-
val codeDetailsList = buildFromCodeLocation(project, assetNavigation.codeLocation)
58+
val codeDetailsList = assetNavigation.codeLocation?.let {
59+
buildFromCodeLocation(project, it)
60+
} ?: listOf()
61+
62+
5963
//if has code locations no need to continue
6064
if (codeDetailsList.isNotEmpty()) {
6165
return CodeLocation(codeDetailsList, listOf())

model/src/main/kotlin/org/digma/intellij/plugin/model/rest/navigation/AssetNavigationResponse.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ data class AssetNavigationResponse
1111
"codeLocation",
1212
"relatedCodeLocations"
1313
)
14-
constructor(val codeLocation: AssetCodeLocation, val relatedCodeLocations: List<AssetRelatedCodeLocation>)
14+
constructor(val codeLocation: AssetCodeLocation?, val relatedCodeLocations: List<AssetRelatedCodeLocation>)
1515

1616
@JsonIgnoreProperties(ignoreUnknown = true)
1717
data class AssetCodeLocation

0 commit comments

Comments
 (0)