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

Commit 77d57d07 authored by Jason Monk's avatar Jason Monk
Browse files

Protect against crash when no NfcAdapter is around

Bug: 26155716
Change-Id: I9e10831ca068263b40fcf06bf83ce341d73e96d2
parent c685853b
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@ package com.android.settings.nfc;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.nfc.NfcAdapter;
import android.os.Bundle;
import android.support.v7.preference.PreferenceManager;
import android.support.v7.preference.PreferenceScreen;
@@ -111,7 +112,7 @@ public class PaymentSettings extends SettingsPreferenceFragment {

        @Override
        public void setListening(boolean listening) {
            if (listening) {
            if (listening && NfcAdapter.getDefaultAdapter(mContext) != null) {
                PaymentBackend paymentBackend = new PaymentBackend(mContext);
                paymentBackend.refresh();
                PaymentAppInfo app = paymentBackend.getDefaultApp();