aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/protocol/Gt06ProtocolDecoder.java
diff options
context:
space:
mode:
authorAbyss777 <abyss@fox5.ru>2018-02-02 13:53:49 +0500
committerAbyss777 <abyss@fox5.ru>2018-02-02 13:53:49 +0500
commitaf49fada37f21df9ed5ceb67504c45b714ec24d4 (patch)
treec3867b51f0e17104fca09c5b4ebd2c308ed6597e /src/org/traccar/protocol/Gt06ProtocolDecoder.java
parent8f4d1c67d3996657c57ed868f34da4066095480c (diff)
downloadtrackermap-server-af49fada37f21df9ed5ceb67504c45b714ec24d4.tar.gz
trackermap-server-af49fada37f21df9ed5ceb67504c45b714ec24d4.tar.bz2
trackermap-server-af49fada37f21df9ed5ceb67504c45b714ec24d4.zip
- Use "media.path" as switch
- Handle if MediaManager undefined
Diffstat (limited to 'src/org/traccar/protocol/Gt06ProtocolDecoder.java')
-rw-r--r--src/org/traccar/protocol/Gt06ProtocolDecoder.java8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/org/traccar/protocol/Gt06ProtocolDecoder.java b/src/org/traccar/protocol/Gt06ProtocolDecoder.java
index 4173b4d5b..e1bb6f96c 100644
--- a/src/org/traccar/protocol/Gt06ProtocolDecoder.java
+++ b/src/org/traccar/protocol/Gt06ProtocolDecoder.java
@@ -703,9 +703,11 @@ public class Gt06ProtocolDecoder extends BaseProtocolDecoder {
if (photo.writableBytes() > 0) {
sendPhotoRequest(channel, pictureId);
} else {
- Device device = Context.getDeviceManager().getById(deviceSession.getDeviceId());
- position.set(
- Position.KEY_IMAGE, Context.getMediaManager().writeFile(device.getUniqueId(), photo, "jpg"));
+ if (Context.getMediaManager() != null) {
+ Device device = Context.getDeviceManager().getById(deviceSession.getDeviceId());
+ position.set(Position.KEY_IMAGE,
+ Context.getMediaManager().writeFile(device.getUniqueId(), photo, "jpg"));
+ }
photos.remove(pictureId);
}