diff options
| author | Jeff Sharkey <jsharkey@android.com> | 2015-05-13 12:38:16 -0700 |
|---|---|---|
| committer | Jeff Sharkey <jsharkey@android.com> | 2015-05-13 12:38:16 -0700 |
| commit | 41be35dd011dbd7ed3a9d08e8fe3eb85ea0e5b64 (patch) | |
| tree | b514c12b63ddc22ab198d51edced0897bfa78d5c /core/java/android/os/FileUtils.java | |
| parent | a49d5fc7677162689ffae85f8b95c57d83868bcf (diff) | |
Rewriting should fail when any paths are null.
Bug: 21017105
Change-Id: I0c5e9c5bdf397d51e2799b06a52bc5bd0bdd09b0
Diffstat (limited to 'core/java/android/os/FileUtils.java')
| -rw-r--r-- | core/java/android/os/FileUtils.java | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/core/java/android/os/FileUtils.java b/core/java/android/os/FileUtils.java index 021e5e4cdd6d..917271d6e670 100644 --- a/core/java/android/os/FileUtils.java +++ b/core/java/android/os/FileUtils.java @@ -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()); |
