Fix crash from gplay console, app crash when no avatar url node is present in API. old gitea instances.

This commit is contained in:
M M Arif 2019-10-02 22:11:10 +05:00
parent b90b3c3320
commit 0bcbca8bdc
2 changed files with 8 additions and 4 deletions

View File

@ -2,7 +2,6 @@ package org.mian.gitnex.adapters;
import android.content.Context;
import android.content.Intent;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

View File

@ -181,9 +181,14 @@ public class ReposListAdapter extends RecyclerView.Adapter<ReposListAdapter.Repo
.endConfig()
.buildRoundRect(firstCharacter, color, 3);
if (!currentItem.getAvatar_url().equals("")) {
Picasso.get().load(currentItem.getAvatar_url()).transform(new RoundedTransformation(8, 0)).resize(120, 120).centerCrop().into(holder.image);
} else {
if (currentItem.getAvatar_url() != null) {
if (!currentItem.getAvatar_url().equals("")) {
Picasso.get().load(currentItem.getAvatar_url()).transform(new RoundedTransformation(8, 0)).resize(120, 120).centerCrop().into(holder.image);
} else {
holder.image.setImageDrawable(drawable);
}
}
else {
holder.image.setImageDrawable(drawable);
}