From 825ee0d178a24620f075cb4ffb8d49c75b046484 Mon Sep 17 00:00:00 2001 From: Abyss777 Date: Tue, 26 Jun 2018 12:05:16 +0500 Subject: Cleanup and some adjustments --- src/org/traccar/model/Notification.java | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'src/org/traccar/model') diff --git a/src/org/traccar/model/Notification.java b/src/org/traccar/model/Notification.java index 0b632c861..4923798c2 100644 --- a/src/org/traccar/model/Notification.java +++ b/src/org/traccar/model/Notification.java @@ -18,6 +18,10 @@ package org.traccar.model; import java.util.HashSet; import java.util.Set; +import org.traccar.database.QueryIgnore; + +import com.fasterxml.jackson.annotation.JsonIgnore; + public class Notification extends ScheduledModel { private boolean always; @@ -52,13 +56,17 @@ public class Notification extends ScheduledModel { } + @JsonIgnore + @QueryIgnore public Set getTransportMethods() { - final Set set = new HashSet<>(); - final String[] tmp = transports.split(","); - for (String t : tmp) { - set.add(t.trim()); + final Set result = new HashSet<>(); + if (transports != null) { + final String[] transportsList = transports.split(","); + for (String transport : transportsList) { + result.add(transport.trim()); + } } - return set; + return result; } } -- cgit v1.2.3