diff options
Diffstat (limited to 'src/org/traccar/BaseProtocolDecoder.java')
-rw-r--r-- | src/org/traccar/BaseProtocolDecoder.java | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/org/traccar/BaseProtocolDecoder.java b/src/org/traccar/BaseProtocolDecoder.java index cbef4568d..aa5be612e 100644 --- a/src/org/traccar/BaseProtocolDecoder.java +++ b/src/org/traccar/BaseProtocolDecoder.java @@ -20,6 +20,7 @@ import io.netty.channel.socket.DatagramChannel; import io.netty.handler.codec.http.HttpRequestDecoder; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import org.traccar.config.Config; import org.traccar.database.ConnectionManager; import org.traccar.database.IdentityManager; import org.traccar.database.StatisticsManager; @@ -44,11 +45,12 @@ public abstract class BaseProtocolDecoder extends ExtendedObjectDecoder { private final Config config = Context.getConfig(); private final IdentityManager identityManager = Context.getIdentityManager(); private final ConnectionManager connectionManager = Context.getConnectionManager(); - private final StatisticsManager statisticsManager = Context.getStatisticsManager(); + private final StatisticsManager statisticsManager; private final Protocol protocol; public BaseProtocolDecoder(Protocol protocol) { this.protocol = protocol; + statisticsManager = Main.getInjector() != null ? Main.getInjector().getInstance(StatisticsManager.class) : null; } public String getProtocolName() { |