Rewriting should fail when any paths are null.

Bug: 21017105
Change-Id: I0c5e9c5bdf397d51e2799b06a52bc5bd0bdd09b0
This commit is contained in:
Jeff Sharkey
2015-05-13 12:38:16 -07:00
parent a49d5fc767
commit 41be35dd01

View File

@@ -528,7 +528,7 @@ public class FileUtils {
* {@code /after/foo/bar.txt}.
*/
public static File rewriteAfterRename(File beforeDir, File afterDir, File file) {
if (file == null) return null;
if (file == null || beforeDir == null || afterDir == null) return null;
if (contains(beforeDir, file)) {
final String splice = file.getAbsolutePath().substring(
beforeDir.getAbsolutePath().length());