diff options
author | merabtenei <i.merabtene.gd@gmail.com> | 2023-05-29 16:03:12 +0100 |
---|---|---|
committer | merabtenei <i.merabtene.gd@gmail.com> | 2023-05-29 16:03:12 +0100 |
commit | 46dabfabdc7b6cc12cbad9863e38ab1ff97c40a5 (patch) | |
tree | d6ede66f05a2a7edb9b204f6d07e02b71e4b0493 /src/main/java/org/traccar/model | |
parent | 6cc15fb06c9490e349847e043eea7c188e88794e (diff) | |
download | trackermap-server-46dabfabdc7b6cc12cbad9863e38ab1ff97c40a5.tar.gz trackermap-server-46dabfabdc7b6cc12cbad9863e38ab1ff97c40a5.tar.bz2 trackermap-server-46dabfabdc7b6cc12cbad9863e38ab1ff97c40a5.zip |
fix return null value
Diffstat (limited to 'src/main/java/org/traccar/model')
-rw-r--r-- | src/main/java/org/traccar/model/ExtendedModel.java | 5 |
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..0a0923ba1 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.containsKey(key); + return value != null ? value.toString() : null; } else { return defaultValue; } |