Fixed #15: "Unfortunately, Maps Geofavorites keeps stopping" and "Maps Geofavorites keeps stopping"

Caused by null fields returned from web APIs
This commit is contained in:
Daniele Verducci (Slimpenguin) 2023-02-15 08:07:17 +01:00
parent 7efd2a2f8b
commit a13e601eea

View File

@ -111,8 +111,8 @@ public class GeofavoriteAdapter extends RecyclerView.Adapter<GeofavoriteAdapter.
holder.tv_category.setText(geofavorite.categoryLetter());
holder.setCategoryColor(
geofavorite.categoryColor() == 0 ? context.getColor(R.color.defaultBrand) : geofavorite.categoryColor());
holder.tv_title.setText(Html.fromHtml(geofavorite.getName()));
holder.tv_content.setText(geofavorite.getComment());
holder.tv_title.setText(Html.fromHtml(geofavorite.getName() == null ? "" : geofavorite.getName()));
holder.tv_content.setText(geofavorite.getComment() == null ? "" : geofavorite.getComment());
holder.tv_date.setText(geofavorite.getLocalDateCreated().format(dateFormatter));
}