[debugger] do not wrap null result in helper

GitOrigin-RevId: 5c2b170084bdc3c857693f9eb2044b8485ecd3e6
This commit is contained in:
Egor Ushakov
2025-03-26 21:06:38 +00:00
committed by intellij-monorepo-bot
parent fb1f6a609f
commit d965580202
2 changed files with 10 additions and 7 deletions
@@ -158,13 +158,13 @@ internal fun tryInvokeWithHelper(
value = value.getValue(0)
if (value is ObjectReference) {
evaluationContext.suspendContext.keepAsync(value)
}
// clear the reference
if (DebuggerUtilsAsync.isAsyncEnabled() && wrapper is ArrayReferenceImpl) {
wrapper.setFirstElementToNull()
}
else {
wrapper.setValue(0, null)
// clear the reference
if (DebuggerUtilsAsync.isAsyncEnabled() && wrapper is ArrayReferenceImpl) {
wrapper.setFirstElementToNull()
}
else {
wrapper.setValue(0, null)
}
}
}
return InvocationResult(true, value)
@@ -235,6 +235,9 @@ public final class MethodInvoker {
}
private static Object keepReference(Object ref, boolean soft) {
if (ref == null) {
return ref;
}
List<Object> objects = keptValues.get();
if (objects == null) {
objects = new LinkedList<>();