Fixes potential crashes
This commit is contained in:
parent
d46652f069
commit
90564d9b2d
|
@ -465,7 +465,7 @@ public class StatusListAdapter extends BaseAdapter implements OnPostActionInterf
|
|||
|
||||
//Redraws top icons (boost/reply)
|
||||
final float scale = context.getResources().getDisplayMetrics().density;
|
||||
if( !status.getIn_reply_to_account_id().equals("null") || !status.getIn_reply_to_id().equals("null") ){
|
||||
if( (status.getIn_reply_to_account_id()!= null && !status.getIn_reply_to_account_id().equals("null")) || (status.getIn_reply_to_id() != null && !status.getIn_reply_to_id().equals("null")) ){
|
||||
Drawable img = ContextCompat.getDrawable(context, R.drawable.ic_reply);
|
||||
img.setBounds(0,0,(int) (20 * iconSizePercent/100 * scale + 0.5f),(int) (15 * iconSizePercent/100 * scale + 0.5f));
|
||||
holder.status_account_displayname.setCompoundDrawables( img, null, null, null);
|
||||
|
|
|
@ -1665,7 +1665,8 @@ public class Helper {
|
|||
Gson gson = new Gson();
|
||||
String json = sharedpreferences.getString(Helper.SET_TEMP_STATUS + userId, null);
|
||||
Type type = new TypeToken<ArrayList<Status>>() {}.getType();
|
||||
return gson.fromJson(json, type);
|
||||
ArrayList<Status> statuses = gson.fromJson(json, type);
|
||||
return (statuses != null)?statuses:new ArrayList<Status>();
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue