Commit 4e70f08c authored by Varun Patil's avatar Varun Patil

Add null check to updateData

parent c5e38b3c
......@@ -42,9 +42,16 @@ public abstract class RecyclerViewFragment<T extends Browsable, S extends Recycl
boolean loading = false;
private boolean allLoaded = false;
/** Update the data clearing existing */
protected void updateData() {
// Skip if we're already destroyed
if (getActivity() == null || getView() == null) return;
// Clear variables
clearPosts();
allLoaded = false;
// Make the request
String sessionIDHeader = ((MainActivity) getActivity()).getSessionIDHeader();
RetrofitInterface retrofitInterface = ((MainActivity) getActivity()).getRetrofitInterface();
Call<List<T>> call = getCall(retrofitInterface, sessionIDHeader);
......
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