Commit f5e16ca6 authored by wnwen's avatar wnwen Committed by Commit bot

Avoid NPE when getCacheDir not available on renderer process.

BUG=481965

Review URL: https://codereview.chromium.org/1116433003

Cr-Commit-Position: refs/heads/master@{#327485}
parent c038962a
......@@ -41,7 +41,10 @@ public abstract class PathUtils {
paths[DATA_DIRECTORY] =
appContext.getDir(dataDirectorySuffix[0], Context.MODE_PRIVATE).getPath();
paths[DATABASE_DIRECTORY] = appContext.getDatabasePath("foo").getParent();
paths[CACHE_DIRECTORY] = appContext.getCacheDir().getPath();
// TODO(wnwen): Find a way to avoid calling this function in renderer process.
if (appContext.getCacheDir() != null) {
paths[CACHE_DIRECTORY] = appContext.getCacheDir().getPath();
}
return paths;
}
}.executeOnExecutor(AsyncTask.SERIAL_EXECUTOR, suffix);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment