From d13a1c72ae78a009b9f666ab115ba1bf0b56e587 Mon Sep 17 00:00:00 2001 From: Katsiaryna Tsytsenia Date: Tue, 2 Apr 2024 13:54:21 +0200 Subject: [PATCH] IJMP-1568 AllocateLikeAction Empty list doesn't contain element at index 0 --- .../formainframe/explorer/actions/AllocateLikeAction.kt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/kotlin/eu/ibagroup/formainframe/explorer/actions/AllocateLikeAction.kt b/src/main/kotlin/eu/ibagroup/formainframe/explorer/actions/AllocateLikeAction.kt index 289fb195..d446a721 100644 --- a/src/main/kotlin/eu/ibagroup/formainframe/explorer/actions/AllocateLikeAction.kt +++ b/src/main/kotlin/eu/ibagroup/formainframe/explorer/actions/AllocateLikeAction.kt @@ -103,10 +103,10 @@ class AllocateLikeAction : AllocateActionBase() { return } val selected = view.mySelectedNodesData - val entityAttributes = selected[0].attributes - e.presentation.isEnabledAndVisible = selected.size == 1 - && entityAttributes is RemoteDatasetAttributes - && !entityAttributes.isMigrated + val entityAttributes = if (selected.size == 1) selected[0].attributes else null + e.presentation.isEnabledAndVisible = entityAttributes != null + && entityAttributes is RemoteDatasetAttributes + && !entityAttributes.isMigrated e.presentation.icon = IconUtil.addText(AllIcons.FileTypes.Any_type, "DS") }