From 22d3e4bc13d26f7f7972d1c5af5fac95f4a26200 Mon Sep 17 00:00:00 2001 From: Andrew Rumble Date: Tue, 5 Nov 2024 15:32:09 +0000 Subject: [PATCH] Merge pull request #21597 from overleaf/ar-fix-error-assistant-error-in-e2e-tests [web] Make sure aiErrorAssistant exists before using GitOrigin-RevId: 31a4a6a2aa152aee6620c8e44e44dea3c6bf3b44 --- services/web/frontend/js/shared/context/editor-context.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/web/frontend/js/shared/context/editor-context.tsx b/services/web/frontend/js/shared/context/editor-context.tsx index 9d414a0fef..c9fc23440b 100644 --- a/services/web/frontend/js/shared/context/editor-context.tsx +++ b/services/web/frontend/js/shared/context/editor-context.tsx @@ -105,7 +105,7 @@ export const EditorProvider: FC = ({ children }) => { ) const [premiumSuggestionResetDate, setPremiumSuggestionResetDate] = useState(() => { - return featureUsage?.aiErrorAssistant.resetDate + return featureUsage?.aiErrorAssistant?.resetDate ? new Date(featureUsage.aiErrorAssistant.resetDate) : new Date() })