Fix null pointer exception when logging suggestions.
In monkey test, the suggestions list can become null. So, add check for valid suggestions list before trying to iterate through the suggestions. Fixes: 64757618 Test: make RunSettingsRoboTests Change-Id: Ib670808a4f222187b9cd53d7d939e71b5ce8dbae
This commit is contained in:
@@ -329,7 +329,11 @@ public class DashboardAdapter extends RecyclerView.Adapter<DashboardAdapter.Dash
|
||||
}
|
||||
|
||||
private void logSuggestions() {
|
||||
for (Tile suggestion : mDashboardData.getSuggestions()) {
|
||||
final List<Tile> suggestions = mDashboardData.getSuggestions();
|
||||
if (suggestions == null) {
|
||||
return;
|
||||
}
|
||||
for (Tile suggestion : suggestions) {
|
||||
final String suggestionId = mSuggestionFeatureProvider.getSuggestionIdentifier(
|
||||
mContext, suggestion);
|
||||
if (!mSuggestionsShownLogged.contains(suggestionId)) {
|
||||
|
Reference in New Issue
Block a user