fix achievement zero issue (#4737)

Co-authored-by: Pratham2305 <Pratham2305@users.noreply.github.com>
This commit is contained in:
Pratham Pahariya 2021-12-22 14:21:43 +05:30 committed by GitHub
parent d38c3f1427
commit d8bfd1ffc5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -216,6 +216,8 @@ public class OkHttpJsonApiClient {
if (json == null) {
return 0;
}
// Extract JSON from response
json = json.substring(json.indexOf('{'));
GetWikidataEditCountResponse countResponse = gson
.fromJson(json, GetWikidataEditCountResponse.class);
if (null != countResponse) {
@ -253,6 +255,8 @@ public class OkHttpJsonApiClient {
if (json == null) {
return null;
}
// Extract JSON from response
json = json.substring(json.indexOf('{'));
Timber.d("Response for achievements is %s", json);
try {
return gson.fromJson(json, FeedbackResponse.class);