Merge 2.10 with master & Fixed merge conflicts (#2844)

This commit is contained in:
Ashish Kumar 2019-04-03 22:39:54 +05:30 committed by Josephine Lim
parent 02ad3b2dc8
commit 08a555c095
18 changed files with 172 additions and 113 deletions

View file

@ -69,6 +69,10 @@ public class CustomMwApi {
}
public void setAuthCookie(String authCookie) {
if (authCookie == null) {//If the authCookie is null, no need to proceed
return;
}
this.authCookie = authCookie;
this.isLoggedIn = true;
String[] cookies = authCookie.split(";");

View file

@ -319,10 +319,13 @@ public class OkHttpJsonApiClient {
if (response.body() != null && response.isSuccessful()) {
String json = response.body().string();
MwQueryResponse mwQueryResponse = gson.fromJson(json, MwQueryResponse.class);
putContinueValues(keyword, mwQueryResponse.continuation());
if (mwQueryResponse.query() == null) {
if (null == mwQueryResponse
|| null == mwQueryResponse.query()
|| null == mwQueryResponse.query().pages()) {
return mediaList;
}
putContinueValues(keyword, mwQueryResponse.continuation());
List<MwQueryPage> pages = mwQueryResponse.query().pages();
for (MwQueryPage page : pages) {
Media media = Media.from(page);