Merge change 6668 into donut

* changes:
  Check if a searchable is null before adding it to the list of searchables for web search. If getActivityMetaData returned null for a web search searchable, previously, this null would get added to the list of searchables for web search, which was causing GlobalSearch's SearchSettings to crash with an NPE (which I've guarded against in change 6602).
This commit is contained in:
Android (Google) Code Review
2009-07-09 15:45:22 -07:00

View File

@@ -247,7 +247,12 @@ public class Searchables {
for (int i = 0; i < webSearchInfoList.size(); ++i) {
ActivityInfo ai = webSearchInfoList.get(i).activityInfo;
ComponentName component = new ComponentName(ai.packageName, ai.name);
newSearchablesForWebSearchList.add(newSearchablesMap.get(component));
SearchableInfo searchable = newSearchablesMap.get(component);
if (searchable == null) {
Log.w(LOG_TAG, "did not find component in searchables: " + component);
} else {
newSearchablesForWebSearchList.add(searchable);
}
}
}