diff --git a/java/debugger/debugger-agent-storage/src/com/intellij/rt/debugger/agent/CaptureStorage.java b/java/debugger/debugger-agent-storage/src/com/intellij/rt/debugger/agent/CaptureStorage.java index 34fd8e8e6b09..014247360396 100644 --- a/java/debugger/debugger-agent-storage/src/com/intellij/rt/debugger/agent/CaptureStorage.java +++ b/java/debugger/debugger-agent-storage/src/com/intellij/rt/debugger/agent/CaptureStorage.java @@ -40,8 +40,7 @@ public class CaptureStorage { if (DEBUG) { System.out.println("capture " + getCallerDescriptor(exception) + " - " + key); } - Deque currentStacks = CURRENT_STACKS.get(); - CapturedStack stack = createCapturedStack(exception, currentStacks.isEmpty() ? null : currentStacks.getLast()); + CapturedStack stack = createCapturedStack(exception, CURRENT_STACKS.get().peekLast()); WeakKey keyRef = new WeakKey(key); synchronized (HISTORY) { CapturedStack old = STORAGE.put(keyRef, stack);