1
0
mirror of https://github.com/mitb-archive/filebot synced 2024-08-13 17:03:45 -04:00

* force proper return value for custom closure

This commit is contained in:
Reinhard Pointner 2012-08-27 11:21:11 +00:00
parent 41b95be589
commit 4fb02fe187

View File

@ -308,7 +308,7 @@ def _renameFunction(fn) {
if (fn instanceof String)
return StandardRenameAction.forName(fn)
if (fn instanceof Closure)
return [rename:fn as Closure, toString:{'CLOSURE'}] as RenameAction
return [rename:{ from, to -> def result = fn.call(from, to); result instanceof File ? result : to }, toString:{'CLOSURE'}] as RenameAction
return fn as RenameAction
}