CWM-6583 ActionUpdater.doUpdate: Index 0 out of bounds for length 0

GitOrigin-RevId: c587e183a55e9ee849bedbda693f8e9ee47373f5
This commit is contained in:
Gregory.Shrago
2022-07-05 19:57:37 +00:00
committed by intellij-monorepo-bot
parent 25f960a0b2
commit d13bc988ba
@@ -60,7 +60,7 @@ internal val AnActionEvent.contextBookmark: Bookmark?
// TODO mouse shortcuts as in gutter/LOGICAL_LINE_AT_CURSOR
val items = getData(PlatformDataKeys.SELECTED_ITEMS)
if (items != null && items.size > 1) return null
val item = items?.get(0) ?: getData(CommonDataKeys.PSI_ELEMENT) ?: getData(CommonDataKeys.VIRTUAL_FILE)
val item = items?.firstOrNull() ?: getData(CommonDataKeys.PSI_ELEMENT) ?: getData(CommonDataKeys.VIRTUAL_FILE)
return when (item) {
is AbstractTreeNode<*> -> manager.createBookmark(item.value)
is SmartElementDescriptor -> manager.createBookmark(item.psiElement)