From 69c6d76fa6f5aba94477fae71fc348cd464ba2ac Mon Sep 17 00:00:00 2001 From: Gábor Somogyi Date: Thu, 5 May 2016 23:24:18 +0200 Subject: Protocol null check added --- src/org/traccar/ServerManager.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/org/traccar/ServerManager.java b/src/org/traccar/ServerManager.java index f79d543ff..5e59851f7 100644 --- a/src/org/traccar/ServerManager.java +++ b/src/org/traccar/ServerManager.java @@ -103,10 +103,12 @@ public class ServerManager { if (protocol != null) { BaseProtocol baseProtocol = protocols.get(protocol); - for (String commandKey : baseProtocol.getSupportedCommands()) { - SupportedCommand supportedCommand = new SupportedCommand(); - supportedCommand.setKey(commandKey); - result.add(supportedCommand); + if (baseProtocol != null) { + for (String commandKey : baseProtocol.getSupportedCommands()) { + SupportedCommand supportedCommand = new SupportedCommand(); + supportedCommand.setKey(commandKey); + result.add(supportedCommand); + } } } -- cgit v1.2.3