Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e4b5d694 authored by Miao Miao (苗苗)'s avatar Miao Miao (苗苗) Committed by Yifan Bai
Browse files

Settings crash when receiving data state broadcast

Stress/Stability testing, Settings crash when receiving data state 
broadcast
Solution: Do null judgement before function was called
Test: Stress/Stability test

Change-Id: Id71448ed89eeffcea268c4a2e7154d9ea7639db4
parent 742bd03f
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -93,8 +93,11 @@ public class CellularDataCondition extends Condition {
        public void onReceive(Context context, Intent intent) {
            if (TelephonyIntents.ACTION_ANY_DATA_CONNECTION_STATE_CHANGED.equals(
                    intent.getAction())) {
                ConditionManager.get(context).getCondition(CellularDataCondition.class)
                        .refreshState();
                CellularDataCondition condition = ConditionManager.get(context).getCondition(
                        CellularDataCondition.class);
                if (condition != null) {
                    condition.refreshState();
                }
            }
        }
    }