diff --git a/source/net/sourceforge/filebot/ui/rename/FilesListTransferablePolicy.java b/source/net/sourceforge/filebot/ui/rename/FilesListTransferablePolicy.java index 186a792f..6fe95270 100644 --- a/source/net/sourceforge/filebot/ui/rename/FilesListTransferablePolicy.java +++ b/source/net/sourceforge/filebot/ui/rename/FilesListTransferablePolicy.java @@ -76,16 +76,23 @@ class FilesListTransferablePolicy extends FileTransferablePolicy { // don't use new Scanner(File) because of BUG 6368019 (http://bugs.sun.com/view_bug.do?bug_id=6368019) try { Scanner scanner = new Scanner(createTextReader(f)); + List paths = new ArrayList(); while (scanner.hasNextLine()) { String line = scanner.nextLine().trim(); if (line.length() > 0) { File path = new File(line); if (path.isAbsolute() && path.exists()) { - queue.add(0, path); + paths.add(path); } } } scanner.close(); + + if (paths.isEmpty()) { + entries.add(f); // treat as simple text file + } else { + queue.addAll(0, paths); // add paths from text file + } } catch (Exception e) { Logger.getLogger(FilesListTransferablePolicy.class.getName()).log(Level.WARNING, e.getMessage()); }