From 5debe74dd68df32e86478a2e54e6f5efdddbf236 Mon Sep 17 00:00:00 2001 From: Abyss777 Date: Fri, 15 Dec 2017 12:28:29 +0500 Subject: Handle boolean parameters in mail related attributes --- src/org/traccar/notification/PropertiesProvider.java | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/org/traccar/notification/PropertiesProvider.java') diff --git a/src/org/traccar/notification/PropertiesProvider.java b/src/org/traccar/notification/PropertiesProvider.java index c5ba688e8..8f5965a82 100644 --- a/src/org/traccar/notification/PropertiesProvider.java +++ b/src/org/traccar/notification/PropertiesProvider.java @@ -61,4 +61,21 @@ public class PropertiesProvider { } } + public Boolean getBoolean(String key) { + if (config != null) { + if (config.hasKey(key)) { + return config.getBoolean(key); + } else { + return null; + } + } else { + Object result = extendedModel.getAttributes().get(key); + if (result != null) { + return result instanceof String ? Boolean.valueOf((String) result) : (Boolean) result; + } else { + return null; + } + } + } + } -- cgit v1.2.3