mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-12 10:49:06 +01:00
Merge branch 'fix_npe_keyfrag' into 'master'
Fix a possible null reference bug See merge request briar/briar!853
This commit is contained in:
@@ -177,7 +177,7 @@ public abstract class KeyAgreementActivity extends BriarActivity implements
|
||||
// FIXME #824
|
||||
FragmentManager fm = getSupportFragmentManager();
|
||||
if (fm.findFragmentByTag(KeyAgreementFragment.TAG) == null) {
|
||||
BaseFragment f = KeyAgreementFragment.newInstance(this);
|
||||
BaseFragment f = KeyAgreementFragment.newInstance();
|
||||
fm.beginTransaction()
|
||||
.replace(R.id.fragmentContainer, f, f.getUniqueTag())
|
||||
.addToBackStack(f.getUniqueTag())
|
||||
|
||||
@@ -91,15 +91,19 @@ public class KeyAgreementFragment extends BaseEventFragment
|
||||
private KeyAgreementTask task;
|
||||
private KeyAgreementEventListener listener;
|
||||
|
||||
public static KeyAgreementFragment newInstance(
|
||||
KeyAgreementEventListener listener) {
|
||||
public static KeyAgreementFragment newInstance() {
|
||||
Bundle args = new Bundle();
|
||||
KeyAgreementFragment fragment = new KeyAgreementFragment();
|
||||
fragment.listener = listener;
|
||||
fragment.setArguments(args);
|
||||
return fragment;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAttach(Context context) {
|
||||
super.onAttach(context);
|
||||
listener = (KeyAgreementEventListener) context;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void injectFragment(ActivityComponent component) {
|
||||
component.inject(this);
|
||||
|
||||
Reference in New Issue
Block a user