From 50c48511a1cc53cee644072555cc325833fd3ba8 Mon Sep 17 00:00:00 2001 From: dangered wolf Date: Tue, 9 Jan 2024 00:50:02 -0500 Subject: [PATCH] Fix rare issue with missing views value --- src/providers/twitter/processor.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/providers/twitter/processor.ts b/src/providers/twitter/processor.ts index f6e29c3..7db0ebf 100644 --- a/src/providers/twitter/processor.ts +++ b/src/providers/twitter/processor.ts @@ -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;