Fix NPE introduced by PY-27227 (EA-113959)

This commit is contained in:
Elizaveta Shashkova
2017-12-14 14:07:21 +03:00
parent 65970e0dd6
commit a7f52f3d32
3 changed files with 5 additions and 3 deletions
@@ -116,7 +116,7 @@ public class PyDebugSupportUtils {
return false;
}
public static boolean isCurrentPythonDebugProcess(Project project) {
public static boolean isCurrentPythonDebugProcess(@NotNull Project project) {
XDebugSession session = XDebuggerManager.getInstance(project).getCurrentSession();
return session != null && session.getDebugProcess() instanceof PyDebugProcess;
}
@@ -71,7 +71,8 @@ class PySetNextStatementAction : XDebuggerActionBase(true) {
override fun getHandler(debuggerSupport: DebuggerSupport) = setNextStatementActionHandler
override fun isHidden(event: AnActionEvent): Boolean {
return !PyDebugSupportUtils.isCurrentPythonDebugProcess(event.getData(CommonDataKeys.PROJECT))
val project = event.getData(CommonDataKeys.PROJECT)
return project == null || !PyDebugSupportUtils.isCurrentPythonDebugProcess(project)
}
companion object {
@@ -58,6 +58,7 @@ public class PyStepIntoMyCodeAction extends XDebuggerActionBase {
@Override
protected boolean isHidden(AnActionEvent event) {
return !PyDebugSupportUtils.isCurrentPythonDebugProcess(event.getData(CommonDataKeys.PROJECT));
Project project = event.getData(CommonDataKeys.PROJECT);
return project == null || !PyDebugSupportUtils.isCurrentPythonDebugProcess(project);
}
}