From 79bd9a130b55610333a88f7738c8e489fc8e3d4e Mon Sep 17 00:00:00 2001 From: smklimenko Date: Thu, 27 Jun 2024 14:35:52 +0100 Subject: [PATCH] =?UTF-8?q?5.8.0=D0=96=20toolbar=20action=20fixed?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../kdb/inside/brains/action/execute/ExecuteAction.java | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/main/java/org/kdb/inside/brains/action/execute/ExecuteAction.java b/src/main/java/org/kdb/inside/brains/action/execute/ExecuteAction.java index ec76ddd..ca20eb4 100644 --- a/src/main/java/org/kdb/inside/brains/action/execute/ExecuteAction.java +++ b/src/main/java/org/kdb/inside/brains/action/execute/ExecuteAction.java @@ -43,11 +43,7 @@ public static boolean isExecutedAllowed(AnActionEvent e) { @Override public void update(@NotNull AnActionEvent e) { final Presentation presentation = e.getPresentation(); - final Editor editor = CommonDataKeys.EDITOR.getData(e.getDataContext()); - if (editor == null) { - presentation.setEnabled(false); - presentation.setVisible(false); - } else if (org.kdb.inside.brains.action.ActionPlaces.KEYBOARD_SHORTCUT.equals(e.getPlace())) { + if (org.kdb.inside.brains.action.ActionPlaces.KEYBOARD_SHORTCUT.equals(e.getPlace())) { presentation.setEnabled(true); presentation.setVisible(false); } else { @@ -58,7 +54,8 @@ public void update(@NotNull AnActionEvent e) { presentation.setVisible(allowed); } - if (allowed) { + final Editor editor = CommonDataKeys.EDITOR.getData(e.getDataContext()); + if (allowed && editor != null) { final InstanceConnection activeInstance = getConnection(e.getProject()); presentation.setEnabled(activeInstance != null && activeInstance.isConnected()); } else {