Check for null when getting PiP action item drawables.

Upon loading the action item drawables, it's possible they end up
returned as null.

Bug: 167338598
Test: None
Change-Id: Iff2b7d499cee275294075a37a4970dc2dbc97401
This commit is contained in:
Ben Lin
2020-09-14 16:55:04 -07:00
parent 55de2996cb
commit e09e8e8a18

View File

@@ -394,8 +394,10 @@ public class PipMenuView extends FrameLayout {
// TODO: Check if the action drawable has changed before we reload it
action.getIcon().loadDrawableAsync(mContext, d -> {
d.setTint(Color.WHITE);
actionView.setImageDrawable(d);
if (d != null) {
d.setTint(Color.WHITE);
actionView.setImageDrawable(d);
}
}, mHandler);
actionView.setContentDescription(action.getContentDescription());
if (action.isEnabled()) {