summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJohn Reck <jreck@google.com>2012-05-03 13:53:50 -0700
committerJohn Reck <jreck@google.com>2012-05-03 13:53:50 -0700
commit3e455284e1e0432fd533de7f082e1426d152d78d (patch)
treef4c0e7d1e1aef2d76b032d40d554f7bb4ab6f24b /src
parentf6504f863a407c9b4615ac14de9b623775f65f69 (diff)
downloadpackages_apps_browser-3e455284e1e0432fd533de7f082e1426d152d78d.zip
packages_apps_browser-3e455284e1e0432fd533de7f082e1426d152d78d.tar.gz
packages_apps_browser-3e455284e1e0432fd533de7f082e1426d152d78d.tar.bz2
Fix NPE
Bug: 6400217 Old saved pages won't have a data file to delete as their data is entirely in the DB. Change-Id: I8f497cec72ca543718b3a1f207e71b0eaa2c14ea
Diffstat (limited to 'src')
-rw-r--r--src/com/android/browser/provider/SnapshotProvider.java7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/com/android/browser/provider/SnapshotProvider.java b/src/com/android/browser/provider/SnapshotProvider.java
index b8b6bcf..e005c36 100644
--- a/src/com/android/browser/provider/SnapshotProvider.java
+++ b/src/com/android/browser/provider/SnapshotProvider.java
@@ -28,6 +28,7 @@ import android.database.sqlite.SQLiteQueryBuilder;
import android.net.Uri;
import android.os.FileUtils;
import android.provider.BrowserContract;
+import android.text.TextUtils;
import java.io.File;
@@ -216,7 +217,11 @@ public class SnapshotProvider extends ContentProvider {
selectionArgs, null, null, null);
final Context context = getContext();
while (c.moveToNext()) {
- File f = context.getFileStreamPath(c.getString(0));
+ String filename = c.getString(0);
+ if (TextUtils.isEmpty(filename)) {
+ continue;
+ }
+ File f = context.getFileStreamPath(filename);
if (f.exists()) {
if (!f.delete()) {
f.deleteOnExit();