summaryrefslogtreecommitdiffstats
path: root/src/com
diff options
context:
space:
mode:
authorJohn Reck <jreck@google.com>2011-09-12 11:18:53 -0700
committerJohn Reck <jreck@google.com>2011-09-12 11:18:53 -0700
commit728abd38d05820cf1a3329d7b5513cf92eef5644 (patch)
tree3762b301754c4414e7274d865b7217d3716a16bf /src/com
parentf5e106165dc27561fc0bb64bcc19a855ee757899 (diff)
downloadpackages_apps_Browser-728abd38d05820cf1a3329d7b5513cf92eef5644.zip
packages_apps_Browser-728abd38d05820cf1a3329d7b5513cf92eef5644.tar.gz
packages_apps_Browser-728abd38d05820cf1a3329d7b5513cf92eef5644.tar.bz2
Add missing null check
Bug: 5297101 Change-Id: Iff8b57ef28d8481f244d937bf980a84de595e7f8
Diffstat (limited to 'src/com')
-rw-r--r--src/com/android/browser/widget/BookmarkThumbnailWidgetService.java10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/com/android/browser/widget/BookmarkThumbnailWidgetService.java b/src/com/android/browser/widget/BookmarkThumbnailWidgetService.java
index 7077885..586f46d 100644
--- a/src/com/android/browser/widget/BookmarkThumbnailWidgetService.java
+++ b/src/com/android/browser/widget/BookmarkThumbnailWidgetService.java
@@ -123,10 +123,12 @@ public class BookmarkThumbnailWidgetService extends RemoteViewsService {
static void removeOrphanedStates(Context context, int[] widgetIds) {
File prefsDirectory = context.getSharedPrefsFile("null").getParentFile();
File[] widgetStates = prefsDirectory.listFiles(new StateFilter(widgetIds));
- for (File f : widgetStates) {
- Log.w(TAG, "Found orphaned state: " + f.getName());
- if (!f.delete()) {
- f.deleteOnExit();
+ if (widgetStates != null) {
+ for (File f : widgetStates) {
+ Log.w(TAG, "Found orphaned state: " + f.getName());
+ if (!f.delete()) {
+ f.deleteOnExit();
+ }
}
}
}