From 80904fd5794b1eb3ef7644c52ce3d09facf9fd04 Mon Sep 17 00:00:00 2001 From: Shinryuken Date: Mon, 6 Nov 2017 23:04:40 +0100 Subject: Minor refactoring changes --- src/org/traccar/notification/NotificationFormatter.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/org/traccar/notification/NotificationFormatter.java') 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); -- cgit v1.2.3