aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEvgeny S Maksimov <me@vragam.net>2018-12-17 12:12:56 +0300
committerGitHub <noreply@github.com>2018-12-17 12:12:56 +0300
commit132b3b21bb7f56fa880a7024d581f36b98b78a7f (patch)
treee14b1297358c78b8cf3cb8cdbaaf84394faacd04 /src
parent4e9ab9892ac2712914a7d6ab865f6255bfcd2218 (diff)
downloadtrackermap-server-132b3b21bb7f56fa880a7024d581f36b98b78a7f.tar.gz
trackermap-server-132b3b21bb7f56fa880a7024d581f36b98b78a7f.tar.bz2
trackermap-server-132b3b21bb7f56fa880a7024d581f36b98b78a7f.zip
Added check of the group parameter.
Diffstat (limited to 'src')
-rw-r--r--src/org/traccar/WebDataHandler.java15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/org/traccar/WebDataHandler.java b/src/org/traccar/WebDataHandler.java
index 49033fc3a..c7ce7485d 100644
--- a/src/org/traccar/WebDataHandler.java
+++ b/src/org/traccar/WebDataHandler.java
@@ -140,16 +140,19 @@ public class WebDataHandler extends BaseDataHandler {
request = request.replace("{gprmc}", formatSentence(position));
}
- String deviceGroupName = "";
-
- if (device.getGroupId() != 0) {
- Group group = Context.getGroupsManager().getById(device.getGroupId());
- if (group != null) {
+ if (request.contains("{group}")) {
+ String deviceGroupName = "";
+ if (device.getGroupId() != 0) {
+ Group group = Context.getGroupsManager().getById(device.getGroupId());
+ if (group != null) {
deviceGroupName = group.getName();
+ }
}
+
+ request = request.replace("{group}", URLEncoder.encode(deviceGroupName, StandardCharsets.UTF_8.name()));
}
- return request.replace("{group}", URLEncoder.encode(deviceGroupName, StandardCharsets.UTF_8.name()));
+ return request;
}
@Override