aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormerabtenei <i.merabtene.gd@gmail.com>2023-05-28 21:38:14 +0100
committermerabtenei <i.merabtene.gd@gmail.com>2023-05-28 21:38:14 +0100
commit6cc15fb06c9490e349847e043eea7c188e88794e (patch)
treee0e8560f6706fded3609fc83e205f4dedbee4e03 /src
parentdee954b9f28c129215e9fa600e6860e2d4adb673 (diff)
downloadtrackermap-server-6cc15fb06c9490e349847e043eea7c188e88794e.tar.gz
trackermap-server-6cc15fb06c9490e349847e043eea7c188e88794e.tar.bz2
trackermap-server-6cc15fb06c9490e349847e043eea7c188e88794e.zip
fix NullPointerException when attribute key is defined and value is set to null, caused by calling .toString() on null.
Diffstat (limited to 'src')
-rw-r--r--src/main/java/org/traccar/model/ExtendedModel.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/main/java/org/traccar/model/ExtendedModel.java b/src/main/java/org/traccar/model/ExtendedModel.java
index 6a4f502f7..d3d247fdd 100644
--- a/src/main/java/org/traccar/model/ExtendedModel.java
+++ b/src/main/java/org/traccar/model/ExtendedModel.java
@@ -90,7 +90,7 @@ public class ExtendedModel extends BaseModel {
}
public String getString(String key, String defaultValue) {
- if (attributes.containsKey(key)) {
+ if (attributes.containsKey(key) && attributes.get(key) != null) {
return attributes.get(key).toString();
} else {
return defaultValue;