From 61d07a123beeaa1e85f44046413a680aabda0c9c Mon Sep 17 00:00:00 2001 From: Gavriel Fleischer Date: Mon, 11 Nov 2019 00:26:01 +0200 Subject: fixed NPE for optional language parameter --- src/main/java/org/traccar/StringProtocolEncoder.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/main/java') diff --git a/src/main/java/org/traccar/StringProtocolEncoder.java b/src/main/java/org/traccar/StringProtocolEncoder.java index 40dfb25b6..e9fb65500 100644 --- a/src/main/java/org/traccar/StringProtocolEncoder.java +++ b/src/main/java/org/traccar/StringProtocolEncoder.java @@ -39,7 +39,7 @@ public abstract class StringProtocolEncoder extends BaseProtocolEncoder { if (valueFormatter != null) { value = valueFormatter.formatValue(keys[i], object); } - if (value == null) { + if (value == null && object != null) { value = object.toString(); } if (value == null) { -- cgit v1.2.3