From: Niki Roo Date: Fri, 22 Jun 2018 05:18:07 +0000 (+0000) Subject: Fix ServerBridge trace NPE X-Git-Url: https://git.nikiroo.be/?a=commitdiff_plain;h=f8f2afb491636143469bc978ba7687a1428513ba;p=fanfix-jexer.git Fix ServerBridge trace NPE --- diff --git a/src/be/nikiroo/utils/serial/server/ServerBridge.java b/src/be/nikiroo/utils/serial/server/ServerBridge.java index 157b27e..ea9fd1b 100644 --- a/src/be/nikiroo/utils/serial/server/ServerBridge.java +++ b/src/be/nikiroo/utils/serial/server/ServerBridge.java @@ -220,7 +220,7 @@ public class ServerBridge extends Server { * the data to trace */ private void trace(String prefix, String data) { - int size = data.length(); + int size = data == null ? 0 : data.length(); String ssize = size + " byte"; if (size > 1) { ssize = size + " bytes";