mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 20:33:53 +01:00
* Added null checks in OkHttpJsonApiClient$searchImages MwQueryResponse
This commit is contained in:
parent
01f6c999ca
commit
963072e184
1 changed files with 7 additions and 0 deletions
|
|
@ -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));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue