IDEA-148408 Raise exception during debugging - only enable in top frame

This commit is contained in:
Egor Ushakov
2017-12-20 12:50:12 +03:00
parent 529fa70826
commit 2cb686f810
@@ -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);