We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent cc0b059 commit c4f159eCopy full SHA for c4f159e
app/src/main/java/fr/free/nrw/commons/mwapi/OkHttpJsonApiClient.java
@@ -1,5 +1,6 @@
1
package fr.free.nrw.commons.mwapi;
2
3
+import android.text.TextUtils;
4
import androidx.annotation.NonNull;
5
import androidx.annotation.Nullable;
6
import com.google.gson.Gson;
@@ -91,7 +92,9 @@ public Single<Integer> getUploadCount(String userName) {
91
92
return Single.fromCallable(() -> {
93
Response response = okHttpClient.newCall(request).execute();
94
if (response != null && response.isSuccessful()) {
- return Integer.parseInt(response.body().string().trim());
95
+ if(!TextUtils.isEmpty(response.body().string().trim())){
96
+ return Integer.parseInt(response.body().string().trim());
97
+ }
98
}
99
return 0;
100
});
0 commit comments