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 ...@@ -340,6 +340,7 @@ public class RoomFragment extends AbstractChatRoomFragment implements
SlidingPaneLayout subPane = getActivity().findViewById(R.id.sub_sliding_pane); SlidingPaneLayout subPane = getActivity().findViewById(R.id.sub_sliding_pane);
sidebarFragment = (SidebarMainFragment) getActivity().getSupportFragmentManager().findFragmentById(R.id.sidebar_fragment_container); sidebarFragment = (SidebarMainFragment) getActivity().getSupportFragmentManager().findFragmentById(R.id.sidebar_fragment_container);
if (pane != null) {
pane.setPanelSlideListener(new SlidingPaneLayout.PanelSlideListener() { pane.setPanelSlideListener(new SlidingPaneLayout.PanelSlideListener() {
@Override @Override
public void onPanelSlide(View view, float v) { public void onPanelSlide(View view, float v) {
...@@ -363,6 +364,7 @@ public class RoomFragment extends AbstractChatRoomFragment implements ...@@ -363,6 +364,7 @@ public class RoomFragment extends AbstractChatRoomFragment implements
} }
}); });
} }
}
public void closeUserActionContainer() { public void closeUserActionContainer() {
sidebarFragment.closeUserActionContainer(); sidebarFragment.closeUserActionContainer();
...@@ -657,6 +659,9 @@ public class RoomFragment extends AbstractChatRoomFragment implements ...@@ -657,6 +659,9 @@ public class RoomFragment extends AbstractChatRoomFragment implements
} }
private void showRoomListFragment(int actionId) { 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) Intent intent = new Intent(getActivity(), RoomActivity.class).putExtra("actionId", actionId)
.putExtra("roomId", roomId) .putExtra("roomId", roomId)
.putExtra("roomType", roomType) .putExtra("roomType", roomType)
...@@ -665,4 +670,5 @@ public class RoomFragment extends AbstractChatRoomFragment implements ...@@ -665,4 +670,5 @@ public class RoomFragment extends AbstractChatRoomFragment implements
.putExtra("userId", userId); .putExtra("userId", userId);
startActivity(intent); 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