Fix NPE
This commit is contained in:
parent
6c93dc4878
commit
7ba966d4c0
1 changed files with 14 additions and 11 deletions
|
@ -258,19 +258,22 @@ public class ContributionVersionActivity extends OsmandListActivity {
|
|||
TextView tagView = (TextView) row.findViewById(R.id.download_tag);
|
||||
tagView.setText(build.tag);
|
||||
|
||||
|
||||
if (build.date != null) {
|
||||
TextView description = (TextView) row.findViewById(R.id.download_descr);
|
||||
StringBuilder format = new StringBuilder();
|
||||
format.append(AndroidUtils.formatDateTime(getMyApplication(), build.date.getTime()))/*.append(" : ").append(build.size).append(" MB")*/;
|
||||
description.setText(format.toString());
|
||||
|
||||
int color = getResources().getColor(R.color.color_unknown);
|
||||
if(currentInstalledDate != null){
|
||||
if(currentInstalledDate.before(build.date)){
|
||||
if (currentInstalledDate != null) {
|
||||
if (currentInstalledDate.before(build.date)) {
|
||||
color = getResources().getColor(R.color.color_update);
|
||||
}
|
||||
}
|
||||
description.setTextColor(color);
|
||||
tagView.setTextColor(color);
|
||||
}
|
||||
|
||||
return row;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue