Skip to content

Commit

Permalink
Merge pull request #68 from AndreySBer/ms_list_dueto_fix
Browse files Browse the repository at this point in the history
Bug found & fixed
  • Loading branch information
phansier committed Jan 20, 2018
2 parents cc7da89 + 548d9fd commit 2757d25
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
public class MilestoneListAdapter extends SingleTypeAdapter<Milestone> {

private final Context context;
private static final String EMPTY_STR = "";
/**
* Create milestone list adapter
*
Expand All @@ -56,7 +57,10 @@ protected void update(int position, Milestone milestone) {
SimpleDateFormat sdf = new SimpleDateFormat(context.getString(R.string.ms_date_format));

setText(0, milestone.title);
setText(1, context.getString(R.string.ms_due_by) + sdf.format(milestone.due_on));
setText(1,
(milestone.due_on != null) ?
context.getString(R.string.ms_due_by) + sdf.format(milestone.due_on)
: EMPTY_STR);
setText(2, context.getString(R.string.ms_opened_issues) + String.valueOf(milestone.open_issues));
setText(3, context.getString(R.string.ms_closed_issues) + String.valueOf(milestone.closed_issues));
}
Expand Down

0 comments on commit 2757d25

Please sign in to comment.