diff --git a/src/components/account-info.jsx b/src/components/account-info.jsx index 45ffc3be..2f8e60fc 100644 --- a/src/components/account-info.jsx +++ b/src/components/account-info.jsx @@ -102,9 +102,12 @@ async function fetchPostingStats(accountID, masto) { }); // Count days since last post - stats.daysSinceLastPost = Math.ceil( - (Date.now() - new Date(statuses[statuses.length - 1].createdAt)) / 86400000, - ); + if (statuses.length) { + stats.daysSinceLastPost = Math.ceil( + (Date.now() - new Date(statuses[statuses.length - 1].createdAt)) / + 86400000, + ); + } console.log('posting stats', stats); return stats;