aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/database/MediaManager.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/org/traccar/database/MediaManager.java')
-rw-r--r--src/org/traccar/database/MediaManager.java5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/org/traccar/database/MediaManager.java b/src/org/traccar/database/MediaManager.java
index 4b5930642..2c448a20c 100644
--- a/src/org/traccar/database/MediaManager.java
+++ b/src/org/traccar/database/MediaManager.java
@@ -40,7 +40,10 @@ public class MediaManager {
private File createFile(String uniqueId, String name) throws IOException {
Path filePath = Paths.get(path, uniqueId, name);
- Files.createDirectories(filePath.getParent());
+ Path directoryPath = filePath.getParent();
+ if (directoryPath != null) {
+ Files.createDirectories(directoryPath);
+ }
return filePath.toFile();
}