Fix possible IllegalStateException in mitmwizard

This commit is contained in:
emanuele-f 2022-09-27 12:50:41 +02:00
parent 04fe20ca95
commit 4720555d26

View File

@ -223,17 +223,25 @@ public class InstallCertificate extends StepFragment implements MitmListener {
@Override
public void onMitmServiceConnect() {
context ctx = getcontext();
if(ctx == null)
return;
if(!mAddon.requestCaCertificate()) {
Toast.makeText(requireContext(), "requestCaCertificate failed", Toast.LENGTH_LONG).show();
Toast.makeText(ctx, "requestCaCertificate failed", Toast.LENGTH_LONG).show();
certFail();
}
}
@Override
public void onMitmServiceDisconnect() {
context ctx = getcontext();
if(ctx == null)
return;
if(mCaPem == null) {
Toast.makeText(requireContext(), "addon disconnected", Toast.LENGTH_LONG).show();
Toast.makeText(ctx, "addon disconnected", Toast.LENGTH_LONG).show();
certFail();
}
}
}
}