GP-1475: Fix three NPEs among Stack and Thread providers

This commit is contained in:
Dan
2021-11-10 17:05:38 -05:00
parent 3aa234e965
commit 2f19f7564d
2 changed files with 23 additions and 10 deletions

View File

@@ -343,16 +343,24 @@ public class DebuggerStackProvider extends ComponentProviderAdapter {
}
private void rowActivated(StackFrameRow row) {
if (row == null) {
return;
}
TraceStackFrame frame = row.frame;
if (frame == null) {
return;
}
TraceThread thread = frame.getStack().getThread();
Trace trace = thread.getTrace();
TraceRecorder recorder = modelService.getRecorder(trace);
if (recorder != null) {
TargetStackFrame targetFrame = recorder.getTargetStackFrame(thread, frame.getLevel());
if (targetFrame != null && targetFrame.isValid()) {
DebugModelConventions.requestActivation(targetFrame);
}
if (recorder == null) {
return;
}
TargetStackFrame targetFrame = recorder.getTargetStackFrame(thread, frame.getLevel());
if (targetFrame == null || !targetFrame.isValid()) {
return;
}
DebugModelConventions.requestActivation(targetFrame);
}
protected void createActions() {

View File

@@ -521,15 +521,20 @@ public class DebuggerThreadsProvider extends ComponentProviderAdapter {
}
private void rowActivated(ThreadRow row) {
if (row == null) {
return;
}
TraceThread thread = row.getThread();
Trace trace = thread.getTrace();
TraceRecorder recorder = modelService.getRecorder(trace);
if (recorder != null) {
TargetThread targetThread = recorder.getTargetThread(thread);
if (targetThread != null && targetThread.isValid()) {
DebugModelConventions.requestActivation(targetThread);
}
if (recorder == null) {
return;
}
TargetThread targetThread = recorder.getTargetThread(thread);
if (targetThread == null || !targetThread.isValid()) {
return;
}
DebugModelConventions.requestActivation(targetThread);
}
protected void buildMainPanel() {