Fix NullPointerException in NetworkProviderSettings

- Avoid calling subfunctions when getView returns null

Bug: 301878710
Test: unit test
Change-Id: I8511ded693475468f6dda1d16d040c623097e997
This commit is contained in:
Weng Su
2023-09-27 03:22:15 +08:00
parent 5872a8f573
commit 725a7d2efd

View File

@@ -190,7 +190,10 @@ public class NetworkProviderSettings extends RestrictedSettingsFragment
@VisibleForTesting
final Runnable mUpdateWifiEntryPreferencesRunnable = () -> {
updateWifiEntryPreferences();
getView().postDelayed(mRemoveLoadingRunnable, 10);
View view = getView();
if (view != null) {
view.postDelayed(mRemoveLoadingRunnable, 10);
}
};
@VisibleForTesting
final Runnable mHideProgressBarRunnable = () -> {