aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorI. MERABTENE <95150308+merabtenei@users.noreply.github.com>2023-05-29 10:35:28 +0100
committerGitHub <noreply@github.com>2023-05-29 10:35:28 +0100
commitef3088a09c42e518fe9c6a313b9c15523adb8b15 (patch)
tree875dbc70e6adfdf7ad21b67e4e97f6df1dca7dbb
parent6cc15fb06c9490e349847e043eea7c188e88794e (diff)
downloadtrackermap-server-ef3088a09c42e518fe9c6a313b9c15523adb8b15.tar.gz
trackermap-server-ef3088a09c42e518fe9c6a313b9c15523adb8b15.tar.bz2
trackermap-server-ef3088a09c42e518fe9c6a313b9c15523adb8b15.zip
Update src/main/java/org/traccar/model/ExtendedModel.java
Co-authored-by: Anton Tananaev <anton.tananaev@gmail.com>
-rw-r--r--src/main/java/org/traccar/model/ExtendedModel.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/main/java/org/traccar/model/ExtendedModel.java b/src/main/java/org/traccar/model/ExtendedModel.java
index d3d247fdd..9da9c7529 100644
--- a/src/main/java/org/traccar/model/ExtendedModel.java
+++ b/src/main/java/org/traccar/model/ExtendedModel.java
@@ -90,8 +90,9 @@ public class ExtendedModel extends BaseModel {
}
public String getString(String key, String defaultValue) {
- if (attributes.containsKey(key) && attributes.get(key) != null) {
- return attributes.get(key).toString();
+ if (attributes.containsKey(key)) {
+ Object value = attributes.get(key);
+ return value != null ? value.toString() : value;
} else {
return defaultValue;
}