EA-985378 NPE: PySmartStepIntoHandler.findVariants

GitOrigin-RevId: feac8a755036a24f1e11acc1ce2a795c09d4ee1b
This commit is contained in:
Andrey Lisin
2023-12-12 14:24:56 +01:00
committed by intellij-monorepo-bot
parent cb36158fb8
commit e45d6031b5
2 changed files with 6 additions and 3 deletions

View File

@@ -4,6 +4,7 @@ package com.jetbrains.python.debugger.pydev;
import com.intellij.openapi.util.Pair;
import com.jetbrains.python.debugger.PyDebuggerException;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.List;
@@ -39,7 +40,7 @@ public class GetSmartStepIntoVariantsCommand extends AbstractFrameCommand {
myVariants = ProtocolParser.parseSmartStepIntoVariants(payload);
}
public List<Pair<String, Boolean>> getVariants() {
public @Nullable List<Pair<String, Boolean>> getVariants() {
return myVariants;
}
}

View File

@@ -625,10 +625,12 @@ public class PyDebugProcess extends XDebugProcess implements IPyDebugProcess, Pr
}
}
public List<Pair<String, Boolean>> getSmartStepIntoVariants(int startContextLine, int endContextLine) {
public @NotNull List<Pair<String, Boolean>> getSmartStepIntoVariants(int startContextLine, int endContextLine) {
try {
PyStackFrame frame = currentFrame();
return myDebugger.getSmartStepIntoVariants(frame.getThreadId(), frame.getFrameId(), startContextLine, endContextLine);
var smartStepIntoVariants = myDebugger.getSmartStepIntoVariants(
frame.getThreadId(), frame.getFrameId(), startContextLine, endContextLine);
return smartStepIntoVariants != null ? smartStepIntoVariants : Collections.emptyList();
}
catch (PyDebuggerException e) {
return Collections.emptyList();