From 2891a1a4eee21e6c80b65915d35558c033503047 Mon Sep 17 00:00:00 2001 From: Ivan Martinez Date: Sun, 1 Apr 2018 18:22:29 -0300 Subject: generalization for notifications processing --- src/org/traccar/notification/NotificatorManager.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/org/traccar/notification/NotificatorManager.java') diff --git a/src/org/traccar/notification/NotificatorManager.java b/src/org/traccar/notification/NotificatorManager.java index 814c8dc1a..1aa76beff 100644 --- a/src/org/traccar/notification/NotificatorManager.java +++ b/src/org/traccar/notification/NotificatorManager.java @@ -19,6 +19,8 @@ package org.traccar.notification; import java.util.HashMap; import java.util.Map; +import org.traccar.Context; + public class NotificatorManager { protected NotificatorManager() { @@ -29,7 +31,9 @@ public class NotificatorManager { private static final Notificator NULL_NOTIFICATOR = new NotificationNull(); static { - NOTIFICATORS.put("sms", new NotificationSms()); + if (Context.getSmsManager() != null) { + NOTIFICATORS.put("sms", new NotificationSms()); + } NOTIFICATORS.put("mail", new NotificationMail()); NOTIFICATORS.put("web", new NotificationWeb()); } -- cgit v1.2.3