From 5fdbb66898e6681873d04fa695adc4165938c321 Mon Sep 17 00:00:00 2001 From: Sergey Simonchik Date: Mon, 28 May 2018 12:46:17 +0300 Subject: [PATCH] check text not-null (IDEA-CR-32979) --- .../execution/testframework/CompositePrintable.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/platform/testRunner/src/com/intellij/execution/testframework/CompositePrintable.java b/platform/testRunner/src/com/intellij/execution/testframework/CompositePrintable.java index 201d44540232..ec746471b60c 100644 --- a/platform/testRunner/src/com/intellij/execution/testframework/CompositePrintable.java +++ b/platform/testRunner/src/com/intellij/execution/testframework/CompositePrintable.java @@ -351,7 +351,9 @@ public class CompositePrintable extends UserDataHolderBase implements Printable, else { ConsoleViewContentType contentType = contentTypeByNameMap.getOrDefault(firstToken, ConsoleViewContentType.NORMAL_OUTPUT); String text = IOUtil.readString(reader); - printText(printer, text, contentType); + if (text != null) { + printText(printer, text, contentType); + } } lineNum++; } @@ -373,7 +375,7 @@ public class CompositePrintable extends UserDataHolderBase implements Printable, } } - private void printText(Printer printer, String text, ConsoleViewContentType contentType) { + private void printText(@NotNull Printer printer, @NotNull String text, @NotNull ConsoleViewContentType contentType) { if (ConsoleViewContentType.NORMAL_OUTPUT.equals(contentType)) { printer.printWithAnsiColoring(text, ProcessOutputTypes.STDOUT); }