diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2017-12-15 23:07:00 +1300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-12-15 23:07:00 +1300 |
commit | 35a8bb5155292083ac4f3dc1a0fe1a9a3921a55f (patch) | |
tree | ba8cc0709e5d285710dc6eabebccadd977328fb5 /src/org/traccar/notification/PropertiesProvider.java | |
parent | c60b59121e7afc32198beaed3b69cdd04a882219 (diff) | |
parent | f8a481a3a4da75139a9b68beef83c3f0528b4572 (diff) | |
download | trackermap-server-35a8bb5155292083ac4f3dc1a0fe1a9a3921a55f.tar.gz trackermap-server-35a8bb5155292083ac4f3dc1a0fe1a9a3921a55f.tar.bz2 trackermap-server-35a8bb5155292083ac4f3dc1a0fe1a9a3921a55f.zip |
Merge pull request #3680 from Abyss777/fix_3679
Handle boolean parameters in mail configuration attributes
Diffstat (limited to 'src/org/traccar/notification/PropertiesProvider.java')
-rw-r--r-- | src/org/traccar/notification/PropertiesProvider.java | 17 |
1 files changed, 17 insertions, 0 deletions
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; + } + } + } + } |