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

Commit 8f4dde53 authored by chelseahao's avatar chelseahao
Browse files

Saving `WifiConfiguration` into a local variable to avoid null pointer.

Test: atest
Bug: b/379862340
Flag: EXEMPT bug fix
Change-Id: If2da9d74e14c062d11176ea836d01e795180a2a9
parent bc454980
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -1506,15 +1506,17 @@ public class InternetDetailsContentController implements AccessPointController.A

    Intent getConfiguratorQrCodeGeneratorIntentOrNull(WifiEntry wifiEntry) {
        if (!mFeatureFlags.isEnabled(Flags.SHARE_WIFI_QS_BUTTON) || wifiEntry == null
                || mWifiManager == null || !wifiEntry.canShare()
                || wifiEntry.getWifiConfiguration() == null) {
                || mWifiManager == null || !wifiEntry.canShare()) {
            return null;
        }
        var wifiConfiguration = wifiEntry.getWifiConfiguration();
        if (wifiConfiguration == null) {
            return null;
        }
        Intent intent = new Intent();
        intent.setAction(WifiDppIntentHelper.ACTION_CONFIGURATOR_AUTH_QR_CODE_GENERATOR);
        intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP);
        WifiDppIntentHelper.setConfiguratorIntentExtra(intent, mWifiManager,
                wifiEntry.getWifiConfiguration());
        WifiDppIntentHelper.setConfiguratorIntentExtra(intent, mWifiManager, wifiConfiguration);
        return intent;
    }
}