From 2cb686f8103dec27da3ba63181f5c2178240b4d2 Mon Sep 17 00:00:00 2001 From: Egor Ushakov Date: Wed, 20 Dec 2017 12:49:35 +0300 Subject: [PATCH] IDEA-148408 Raise exception during debugging - only enable in top frame --- .../com/intellij/debugger/actions/ThrowExceptionAction.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/java/debugger/impl/src/com/intellij/debugger/actions/ThrowExceptionAction.java b/java/debugger/impl/src/com/intellij/debugger/actions/ThrowExceptionAction.java index ed1acc074d42..89c7507ea7c5 100644 --- a/java/debugger/impl/src/com/intellij/debugger/actions/ThrowExceptionAction.java +++ b/java/debugger/impl/src/com/intellij/debugger/actions/ThrowExceptionAction.java @@ -122,7 +122,8 @@ public class ThrowExceptionAction extends DebuggerAction { } public void update(@NotNull AnActionEvent e) { - boolean enable = PopFrameAction.getStackFrame(e) != null; + JavaStackFrame stackFrame = PopFrameAction.getStackFrame(e); + boolean enable = stackFrame != null && stackFrame.getDescriptor().getUiIndex() == 0; if (ActionPlaces.isMainMenuOrActionSearch(e.getPlace()) || ActionPlaces.DEBUGGER_TOOLBAR.equals(e.getPlace())) { e.getPresentation().setEnabled(enable);