aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/notification
diff options
context:
space:
mode:
Diffstat (limited to 'src/org/traccar/notification')
-rw-r--r--src/org/traccar/notification/NotificationFormatter.java5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/org/traccar/notification/NotificationFormatter.java b/src/org/traccar/notification/NotificationFormatter.java
index 56dbf7270..591f848d4 100644
--- a/src/org/traccar/notification/NotificationFormatter.java
+++ b/src/org/traccar/notification/NotificationFormatter.java
@@ -111,7 +111,10 @@ public final class NotificationFormatter {
private static String formatterLogic(VelocityContext vc, Long userId, Event event, Position position,
String templatePath) {
- VelocityContext velocityContext = vc != null ? vc : prepareContext(userId, event, position);
+ VelocityContext velocityContext = vc;
+ if (velocityContext == null) {
+ velocityContext = prepareContext(userId, event, position);
+ }
StringWriter writer = new StringWriter();
getTemplate(event, templatePath).merge(velocityContext, writer);