Fix NPE when trying to refreshes dnd condition.

am: 98487f4d65

Change-Id: I27d984f6ebb1de4832d819a843c9cdbfeeabeaf8
This commit is contained in:
Fan Zhang
2016-09-23 23:37:49 +00:00
committed by android-build-merger

View File

@@ -139,8 +139,11 @@ public class DndCondition extends Condition {
public void onReceive(Context context, Intent intent) {
if (NotificationManager.ACTION_INTERRUPTION_FILTER_CHANGED_INTERNAL
.equals(intent.getAction())) {
ConditionManager.get(context).getCondition(DndCondition.class)
.refreshState();
final Condition condition =
ConditionManager.get(context).getCondition(DndCondition.class);
if (condition != null) {
condition.refreshState();
}
}
}
}