From 4264fc42d61136bf46bbc7bbc5a7db6159f47e0c Mon Sep 17 00:00:00 2001 From: kyori Date: Mon, 20 Aug 2018 19:29:58 +0900 Subject: [PATCH] Add process for when the createdAt is null. --- .../com/keylesspalace/tusky/adapter/NotificationsAdapter.java | 4 +++- .../com/keylesspalace/tusky/adapter/StatusBaseViewHolder.java | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/keylesspalace/tusky/adapter/NotificationsAdapter.java b/app/src/main/java/com/keylesspalace/tusky/adapter/NotificationsAdapter.java index 5f9f5261..4c937c4d 100644 --- a/app/src/main/java/com/keylesspalace/tusky/adapter/NotificationsAdapter.java +++ b/app/src/main/java/com/keylesspalace/tusky/adapter/NotificationsAdapter.java @@ -388,8 +388,10 @@ public class NotificationsAdapter extends RecyclerView.Adapter { sdf = new SimpleDateFormat("HH:mm:ss", Locale.getDefault()); } time = sdf.format(createdAt); - timestampInfo.setText(time); + } else { + time = "??:??:??"; } + timestampInfo.setText(time); } else { // This is the visible timestampInfo. String readout; diff --git a/app/src/main/java/com/keylesspalace/tusky/adapter/StatusBaseViewHolder.java b/app/src/main/java/com/keylesspalace/tusky/adapter/StatusBaseViewHolder.java index 2384de8a..185156f9 100644 --- a/app/src/main/java/com/keylesspalace/tusky/adapter/StatusBaseViewHolder.java +++ b/app/src/main/java/com/keylesspalace/tusky/adapter/StatusBaseViewHolder.java @@ -142,8 +142,10 @@ abstract class StatusBaseViewHolder extends RecyclerView.ViewHolder { sdf = new SimpleDateFormat("HH:mm:ss", Locale.getDefault()); } time = sdf.format(createdAt); - timestampInfo.setText(time); + } else { + time = "??:??:??"; } + timestampInfo.setText(time); } else { // This is the visible timestampInfo. String readout;