Fixes #1949253. Prevents NPE on startup.

This commit is contained in:
Romain Guy
2009-06-29 14:55:08 -07:00
parent 14b3c0c9a4
commit 14035e8634

View File

@@ -255,6 +255,12 @@ public class Home extends Activity {
private void bindFavorites(boolean isLaunching) { private void bindFavorites(boolean isLaunching) {
if (!isLaunching || mFavorites == null) { if (!isLaunching || mFavorites == null) {
if (mFavorites == null) {
mFavorites = new LinkedList<ApplicationInfo>();
} else {
mFavorites.clear();
}
FileReader favReader; FileReader favReader;
// Environment.getRootDirectory() is a fancy way of saying ANDROID_ROOT or "/system". // Environment.getRootDirectory() is a fancy way of saying ANDROID_ROOT or "/system".
@@ -266,12 +272,6 @@ public class Home extends Activity {
return; return;
} }
if (mFavorites == null) {
mFavorites = new LinkedList<ApplicationInfo>();
} else {
mFavorites.clear();
}
final Intent intent = new Intent(Intent.ACTION_MAIN, null); final Intent intent = new Intent(Intent.ACTION_MAIN, null);
intent.addCategory(Intent.CATEGORY_LAUNCHER); intent.addCategory(Intent.CATEGORY_LAUNCHER);