From 32eaa8ea88c98a695a99d18a64c7261507edd541 Mon Sep 17 00:00:00 2001 From: Alexander Koshevoy Date: Mon, 6 Aug 2018 14:37:32 +0300 Subject: [PATCH] PY-18029 Fix NPE on handling returnFullValue() request after closing Python Console --- .../python/console/PydevConsoleCommunication.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/python/src/com/jetbrains/python/console/PydevConsoleCommunication.java b/python/src/com/jetbrains/python/console/PydevConsoleCommunication.java index 1fcf89125576..0040eac1d64a 100644 --- a/python/src/com/jetbrains/python/console/PydevConsoleCommunication.java +++ b/python/src/com/jetbrains/python/console/PydevConsoleCommunication.java @@ -746,16 +746,18 @@ public class PydevConsoleCommunication extends AbstractConsoleCommunication impl final List> values = myCallbackHashMap.remove(requestSeq); try { List debugValues = response.stream() - .map(value -> createPyDebugValue(value, PydevConsoleCommunication.this)) - .collect(Collectors.toList()); + .map(value -> createPyDebugValue(value, PydevConsoleCommunication.this)) + .collect(Collectors.toList()); for (int i = 0; i < debugValues.size(); ++i) { PyDebugValue resultValue = debugValues.get(i); values.get(i).getCallback().ok(resultValue.getValue()); } } catch (Exception e) { - for (PyFrameAccessor.PyAsyncValue vars : values) { - vars.getCallback().error(new PyDebuggerException(response.toString())); + if (values != null) { + for (PyFrameAccessor.PyAsyncValue vars : values) { + vars.getCallback().error(new PyDebuggerException(response.toString())); + } } } }