Commit 274e47f9 authored by Leonardo Aramaki's avatar Leonardo Aramaki

Add nullity checks

parent 8d985b42
......@@ -340,6 +340,7 @@ public class RoomFragment extends AbstractChatRoomFragment implements
SlidingPaneLayout subPane = getActivity().findViewById(R.id.sub_sliding_pane);
sidebarFragment = (SidebarMainFragment) getActivity().getSupportFragmentManager().findFragmentById(R.id.sidebar_fragment_container);
if (pane != null) {
pane.setPanelSlideListener(new SlidingPaneLayout.PanelSlideListener() {
@Override
public void onPanelSlide(View view, float v) {
......@@ -363,6 +364,7 @@ public class RoomFragment extends AbstractChatRoomFragment implements
}
});
}
}
public void closeUserActionContainer() {
sidebarFragment.closeUserActionContainer();
......@@ -657,6 +659,9 @@ public class RoomFragment extends AbstractChatRoomFragment implements
}
private void showRoomListFragment(int actionId) {
//TODO: oddly sometimes getActivity() yields null. Investigate the situations this might happen
//and fix it, removing this null-check
if (getActivity() != null) {
Intent intent = new Intent(getActivity(), RoomActivity.class).putExtra("actionId", actionId)
.putExtra("roomId", roomId)
.putExtra("roomType", roomType)
......@@ -665,4 +670,5 @@ public class RoomFragment extends AbstractChatRoomFragment implements
.putExtra("userId", userId);
startActivity(intent);
}
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment