From 7246644f393f9a373f4e3f2be846500e8456a286 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Thu, 29 Sep 2022 17:23:16 -0700 Subject: Simplify commands logic --- src/main/java/org/traccar/database/CommandsManager.java | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'src/main/java/org') diff --git a/src/main/java/org/traccar/database/CommandsManager.java b/src/main/java/org/traccar/database/CommandsManager.java index 49eda79b2..945fb13af 100644 --- a/src/main/java/org/traccar/database/CommandsManager.java +++ b/src/main/java/org/traccar/database/CommandsManager.java @@ -83,13 +83,8 @@ public class CommandsManager { } } else { DeviceSession deviceSession = connectionManager.getDeviceSession(deviceId); - if (deviceSession != null) { - if (deviceSession.supportsLiveCommands()) { - deviceSession.sendCommand(command); - } else { - getDeviceQueue(deviceId).add(command); - return false; - } + if (deviceSession != null && deviceSession.supportsLiveCommands()) { + deviceSession.sendCommand(command); } else { getDeviceQueue(deviceId).add(command); return false; -- cgit v1.2.3