aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/MainModule.java
diff options
context:
space:
mode:
authorRafael E. Ajuria <reajuria@users.noreply.github.com>2023-06-10 14:01:11 +0000
committerRafael E. Ajuria <reajuria@users.noreply.github.com>2023-06-10 14:01:11 +0000
commitdc22bc5feef7887d3baec1b2904fc18e1d067378 (patch)
treeb63378c84dcf5c6098fad97437b91dc767922107 /src/main/java/org/traccar/MainModule.java
parenta39af3b4d72f3ed8a6dfe868d365d6bbf34e18d3 (diff)
downloadtrackermap-server-dc22bc5feef7887d3baec1b2904fc18e1d067378.tar.gz
trackermap-server-dc22bc5feef7887d3baec1b2904fc18e1d067378.tar.bz2
trackermap-server-dc22bc5feef7887d3baec1b2904fc18e1d067378.zip
cleanup broadcast type
Diffstat (limited to 'src/main/java/org/traccar/MainModule.java')
-rw-r--r--src/main/java/org/traccar/MainModule.java17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/main/java/org/traccar/MainModule.java b/src/main/java/org/traccar/MainModule.java
index 950a7278a..b7bdbc6bf 100644
--- a/src/main/java/org/traccar/MainModule.java
+++ b/src/main/java/org/traccar/MainModule.java
@@ -341,14 +341,17 @@ public class MainModule extends AbstractModule {
@Provides
public static BroadcastService provideBroadcastService(
Config config, ObjectMapper objectMapper) throws IOException {
- switch (config.getString(Keys.BROADCAST_TYPE)) {
- case "multicast":
- return new MulticastBroadcastService(config, objectMapper);
- case "redis":
- return new RedisBroadcastService(config, objectMapper);
- default:
- return new NullBroadcastService();
+ if (config.hasKey(Keys.BROADCAST_TYPE)) {
+ switch (config.getString(Keys.BROADCAST_TYPE)) {
+ case "multicast":
+ return new MulticastBroadcastService(config, objectMapper);
+ case "redis":
+ return new RedisBroadcastService(config, objectMapper);
+ default:
+ break;
+ }
}
+ return new NullBroadcastService();
}
@Singleton