Check whether qsIcon is null before using it

Bug: 176428921
Test: Unit Tests, Manual Tests
Change-Id: Ic76e9ad4237b1a5bf71d1ee9801c91d0f3b6e476
This commit is contained in:
yinxu
2021-01-21 13:47:11 -08:00
parent ee5aac1dff
commit 0e87f757ca

View File

@@ -274,7 +274,8 @@ public class CastTile extends QSTileImpl<BooleanState> {
NetworkController.IconState qsIcon, boolean activityIn, boolean activityOut,
String description, boolean isTransient, String statusLabel) {
// statusIcon.visible has the connected status information
boolean enabledAndConnected = enabled && qsIcon.visible;
boolean enabledAndConnected =
enabled && (qsIcon == null ? false : qsIcon.visible);
if (enabledAndConnected != mWifiConnected) {
mWifiConnected = enabledAndConnected;
// Hotspot is not connected, so changes here should update