]> gitweb.fperrin.net Git - GpsPrune.git/blobdiff - tim/prune/load/MediaHelper.java
Version 14, October 2012
[GpsPrune.git] / tim / prune / load / MediaHelper.java
index c55fc557ec6ee7bc5b58df0e19879b35935362ba..ab4f366d820967c67674e916c15985cddc5debb2 100644 (file)
@@ -88,7 +88,11 @@ public abstract class MediaHelper
                }
 
                // If we haven't got a result by now, try to load plain file
-               File file = (inSourceFile == null ? new File(inPath) : new File(inSourceFile.getParent(), inPath));
+               File file = new File(inPath);
+               if (inSourceFile != null && !file.isAbsolute()) {
+                       file = new File(inSourceFile.getParent(), inPath);
+               }
+               // awkward construction because new File(startPath, absolutePath) doesn't work
                return createMediaObject(file);
        }