Ensure that the RemoteResponse is not empty before acting on it

Potential NPE was added in ag/14881530

Fix: 190353630
Test: locally with sample app with and without items
Change-Id: I946b6b6719600cb638db1b15d74a8c3af6587f32
This commit is contained in:
Stevie Kideckel
2021-06-10 09:59:01 +00:00
parent 50ae7cbf1b
commit b72cf99044

View File

@@ -814,7 +814,9 @@ public class RemoteViews implements Parcelable, Filter {
// The PendingIntent template is stored in the view's tag.
OnItemClickListener listener = (parent, view, position, id) -> {
RemoteResponse response = findRemoteResponseTag(view);
response.handleViewInteraction(view, handler);
if (response != null) {
response.handleViewInteraction(view, handler);
}
};
av.setOnItemClickListener(listener);
av.setTag(pendingIntentTemplate);