Fix rare issue with missing views value

This commit is contained in:
dangered wolf 2024-01-09 00:50:02 -05:00
parent 0d88de2d86
commit 50c48511a1
No known key found for this signature in database
GPG key ID: 41E4D37680ED8B58

View file

@ -103,7 +103,7 @@ export const buildAPITwitterStatus = async (
apiStatus.possibly_sensitive = status.legacy.possibly_sensitive;
if (status.views.state === 'EnabledWithCount') {
if (status.views?.state === 'EnabledWithCount') {
apiStatus.views = parseInt(status.views.count || '0') ?? null;
} else {
apiStatus.views = null;