Skip to content
Snippets Groups Projects
Verified Commit 28ea3d01 authored by Julian Dehm's avatar Julian Dehm
Browse files

Fix a possible null reference bug

parent 457d77ca
No related branches found
No related tags found
No related merge requests found
......@@ -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);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment