From 34539d080f2ce05eb668267180283f8332835d2c Mon Sep 17 00:00:00 2001 From: cyBerta Date: Mon, 7 Aug 2023 03:08:33 +0200 Subject: avoid possible NPEs in ConfigureProviderFragment --- .../providersetup/fragments/ConfigureProviderFragment.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'app/src/main') diff --git a/app/src/main/java/se/leap/bitmaskclient/providersetup/fragments/ConfigureProviderFragment.java b/app/src/main/java/se/leap/bitmaskclient/providersetup/fragments/ConfigureProviderFragment.java index 01bedfa0..3c36065e 100644 --- a/app/src/main/java/se/leap/bitmaskclient/providersetup/fragments/ConfigureProviderFragment.java +++ b/app/src/main/java/se/leap/bitmaskclient/providersetup/fragments/ConfigureProviderFragment.java @@ -147,10 +147,13 @@ public class ConfigureProviderFragment extends BaseSetupFragment implements Obse public void update(Observable o, Object arg) { if (o instanceof TorStatusObservable) { Activity activity = getActivity(); - if (activity == null) { + if (activity == null || binding == null) { return; } activity.runOnUiThread(() -> { + if (binding == null) { + return; + } if (TorStatusObservable.getStatus() != TorStatusObservable.TorStatus.OFF) { if (binding.connectionDetailContainer.getVisibility() == GONE) { showConnectionDetails(); -- cgit v1.2.3