Fixed crash when starting app (NullPointer in ChatListPresenter/Fragment)

This commit is contained in:
ChronosX88 2019-03-20 14:57:48 +04:00
parent 4dd6eca565
commit a8bc9ab2fc
Signed by: ChronosXYZ
GPG Key ID: 085A69A82C8C511A
2 changed files with 2 additions and 2 deletions

View File

@ -14,8 +14,8 @@ public class ChatListPresenter implements ChatListPresenterContract {
public ChatListPresenter(ChatListViewContract view) {
this.view = view;
chatListAdapter = new ChatListAdapter();
this.view.setRecycleAdapter(chatListAdapter);
this.logic = new ChatListLogic();
this.view.setRecycleAdapter(chatListAdapter);
}
@Override

View File

@ -28,7 +28,6 @@ public class ChatListFragment extends Fragment implements ChatListViewContract,
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
presenter = new ChatListPresenter(this);
AppHelper.getObservable().register(this, MainObservable.UI_ACTIONS_CHANNEL);
}
@ -42,6 +41,7 @@ public class ChatListFragment extends Fragment implements ChatListViewContract,
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
chatList = view.findViewById(R.id.chatlist_container);
presenter = new ChatListPresenter(this);
presenter.updateChatList();
}