aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/model/ExtendedModel.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/org/traccar/model/ExtendedModel.java')
-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;
}