From 19779bca02601b530eae4b3ae796739b4f20befa Mon Sep 17 00:00:00 2001 From: Vyacheslav Matyukhin Date: Thu, 26 May 2022 17:02:26 +0400 Subject: [PATCH] fix: handle empty guesstimate descriptions --- src/backend/platforms/guesstimate.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/backend/platforms/guesstimate.ts b/src/backend/platforms/guesstimate.ts index c10a3dc..61f34c4 100644 --- a/src/backend/platforms/guesstimate.ts +++ b/src/backend/platforms/guesstimate.ts @@ -22,7 +22,7 @@ const modelToQuestion = (model: any): ReturnType => { title: model.name, url: `https://www.getguesstimate.com/models/${model.id}`, // timestamp, - description, + description: description || "", options: [], qualityindicators: { numforecasts: 1, @@ -90,5 +90,5 @@ export const guesstimate: Platform & { search, version: "v1", fetchQuestion, - calculateStars: (q) => (q.description.length > 250 ? 2 : 1), + calculateStars: (q) => (q.description?.length > 250 ? 2 : 1), };