commit 6893c07b0e69e6eb0ee0d76937fb3974b689ba59 Author: n8fr8 nathan@guardianproject.info Date: Thu Aug 20 09:16:04 2020 -0400
for #382 don't set textview value if it is nulled --- .../ui/onboarding/BridgeWizardActivity.java | 24 ++++++++++++++-------- 1 file changed, 15 insertions(+), 9 deletions(-)
diff --git a/app/src/main/java/org/torproject/android/ui/onboarding/BridgeWizardActivity.java b/app/src/main/java/org/torproject/android/ui/onboarding/BridgeWizardActivity.java index f0b06b2b..8585c29c 100644 --- a/app/src/main/java/org/torproject/android/ui/onboarding/BridgeWizardActivity.java +++ b/app/src/main/java/org/torproject/android/ui/onboarding/BridgeWizardActivity.java @@ -171,9 +171,12 @@ public class BridgeWizardActivity extends AppCompatActivity { private class HostTester extends AsyncTask<String, Void, Boolean> { @Override protected void onPreExecute() { - // Pre Code - mTvStatus.setVisibility(View.VISIBLE); - mTvStatus.setText(mBtDirect.isChecked() ? R.string.testing_tor_direct : R.string.testing_bridges); + + if (mTvStatus != null) { + // Pre Code + mTvStatus.setVisibility(View.VISIBLE); + mTvStatus.setText(mBtDirect.isChecked() ? R.string.testing_tor_direct : R.string.testing_bridges); + } }
@Override @@ -195,12 +198,15 @@ public class BridgeWizardActivity extends AppCompatActivity { @Override protected void onPostExecute(Boolean result) { // Post Code - runningHostTest = null; - if (result) { - int stringRes = mBtDirect.isChecked() ? R.string.testing_tor_direct_success : R.string.testing_bridges_success; - mTvStatus.setText(stringRes); - } else { - mTvStatus.setText(R.string.testing_bridges_fail); + if (mTvStatus != null) + { + runningHostTest = null; + if (result) { + int stringRes = mBtDirect.isChecked() ? R.string.testing_tor_direct_success : R.string.testing_bridges_success; + mTvStatus.setText(stringRes); + } else { + mTvStatus.setText(R.string.testing_bridges_fail); + } } } }