From 92fc888a6a612e06a14179e700a97f1019f6f27e Mon Sep 17 00:00:00 2001 From: "Vitaliy.Bibaev" Date: Mon, 16 Jul 2018 18:18:58 +0300 Subject: [PATCH] EA-124885 Prevent NPE --- .../intellij/debugger/streams/ui/impl/CollectionTree.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/plugins/stream-debugger/src/com/intellij/debugger/streams/ui/impl/CollectionTree.java b/plugins/stream-debugger/src/com/intellij/debugger/streams/ui/impl/CollectionTree.java index 882a4c59f4fb..fb2eda2f93e5 100644 --- a/plugins/stream-debugger/src/com/intellij/debugger/streams/ui/impl/CollectionTree.java +++ b/plugins/stream-debugger/src/com/intellij/debugger/streams/ui/impl/CollectionTree.java @@ -274,14 +274,18 @@ public class CollectionTree extends XDebuggerTree implements TraceContainer { int topIndex = 0; int bottomIndex = 1; - int topY = getRowBounds(rows[topIndex]).y; + Rectangle rowBounds = getRowBounds(rows[topIndex]); + if (rowBounds == null) return visibleRect; + int topY = rowBounds.y; final Result result = new Result(); while (bottomIndex < rows.length) { final int nextY = getRowBounds(rows[bottomIndex]).y; while (nextY - topY > height) { topIndex++; - topY = getRowBounds(rows[topIndex]).y; + rowBounds = getRowBounds(rows[topIndex]); + if (rowBounds == null) return visibleRect; + topY = rowBounds.y; } if (bottomIndex - topIndex > result.count()) {