BugFix issue #2711 (#2712)

* Added null checks in OkHttpJsonApiClient$searchImages MwQueryResponse
This commit is contained in:
Ashish Kumar 2019-03-23 00:45:16 +05:30 committed by Vivek Maskara
parent 01f6c999ca
commit 963072e184

View file

@ -242,6 +242,13 @@ public class OkHttpJsonApiClient {
return mediaList;
}
MwQueryResponse mwQueryResponse = gson.fromJson(json, MwQueryResponse.class);
if (null == mwQueryResponse
|| null == mwQueryResponse.query()
|| null == mwQueryResponse.query().pages()) {
return mediaList;
}
List<MwQueryPage> pages = mwQueryResponse.query().pages();
for (MwQueryPage page : pages) {
mediaList.add(Media.from(page));