Skip to content

Commit 3e1b468

Browse files
Fix various occasions where invalid PsiElements could be shown in line marker popups by filtering on validity
1 parent b23a7a9 commit 3e1b468

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
### Fixed
88
- [#59] Fixed ClassCastException during querying provider ClassLineMarkerProvider (thanks @kaleev for reporting the error)
9+
- Fix various occasions where invalid PsiElements could be shown in line marker popups by filtering on validity
910

1011
## [0.6.1]
1112

src/main/kotlin/org/axonframework/intellij/ide/plugin/markers/AxonNavigationGutterIconRenderer.kt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ class AxonNavigationGutterIconRenderer(
6262

6363
override fun navigateToItems(event: MouseEvent?) {
6464
if (event != null) {
65-
val elements = PsiUtilCore.toPsiElementArray(targetElements)
65+
val elements = PsiUtilCore.toPsiElementArray(targetElements.filter { it.isValid })
6666
val popup = NavigationUtil.getPsiElementPopup(elements, myCellRenderer.compute(), myPopupTitle)
6767
popup.show(RelativePoint(event))
6868
}
@@ -76,7 +76,11 @@ class AxonNavigationGutterIconRenderer(
7676
{ tooltipText },
7777
this,
7878
alignment,
79-
{ elements.value.map { WrappedGoToRelatedItem(it) } }
79+
{
80+
elements.value
81+
.filter { it.element.isValid }
82+
.map { WrappedGoToRelatedItem(it) }
83+
}
8084
)
8185
}
8286
}

0 commit comments

Comments
 (0)