From 27754445905338b946653a9c7f1313044f13525c Mon Sep 17 00:00:00 2001 From: Remi Blom-Ohlsen Date: Wed, 6 Nov 2024 15:46:44 +0100 Subject: [PATCH] Add optional chaining to handle cases where initialSelectedReport is undefined" [packages-only] --- .../ProjectWebParts/src/components/ProjectStatus/reducer.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SharePointFramework/ProjectWebParts/src/components/ProjectStatus/reducer.ts b/SharePointFramework/ProjectWebParts/src/components/ProjectStatus/reducer.ts index 4e7df3cc9..ada895aa3 100644 --- a/SharePointFramework/ProjectWebParts/src/components/ProjectStatus/reducer.ts +++ b/SharePointFramework/ProjectWebParts/src/components/ProjectStatus/reducer.ts @@ -107,7 +107,7 @@ const createProjectStatusReducer = createReducer(initialState, { state.userHasAdminPermission = payload.data.userHasAdminPermission state.isDataLoaded = true - if (payload.initialSelectedReport.published) { + if (payload.initialSelectedReport?.published) { state.reportStatus = format( strings.PublishedStatusReport, formatDate(payload.initialSelectedReport?.publishedDate)