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
Merged-In: Iff2b7d499cee275294075a37a4970dc2dbc97401
Change-Id: Iff2b7d499cee275294075a37a4970dc2dbc97401
(cherry picked from commit e09e8e8a18)
This commit is contained in:
Ben Lin
2020-09-14 16:55:04 -07:00
parent 0d6e0d8e36
commit 7cdf920187

View File

@@ -562,8 +562,10 @@ public class PipMenuActivity extends Activity {
// TODO: Check if the action drawable has changed before we reload it
action.getIcon().loadDrawableAsync(this, 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()) {