diff --git a/source/net/sourceforge/filebot/ui/rename/RenameAction.java b/source/net/sourceforge/filebot/ui/rename/RenameAction.java index 7de3b093..f5b73094 100644 --- a/source/net/sourceforge/filebot/ui/rename/RenameAction.java +++ b/source/net/sourceforge/filebot/ui/rename/RenameAction.java @@ -171,6 +171,9 @@ class RenameAction extends AbstractAction { if (destinationSet.contains(destination)) throw new IllegalArgumentException("Conflict detected: " + mapping.getValue().getPath()); + if (destination.exists() && !resolveDestination(mapping.getKey(), mapping.getValue(), false).equals(mapping.getKey())) + throw new IllegalArgumentException("File already exists: " + mapping.getValue().getPath()); + // use original mapping values renameMap.put(mapping.getKey(), mapping.getValue()); destinationSet.add(destination);