[bug[ Check for already existing files and folder before rename.

Fixes #2560 

...then again, there is no real need to assign an empty `[]`: you could just `if (childNames != null && childNames...)` below.