Skip to content

Commit

Permalink
Add optional chaining to handle cases where initialSelectedReport is …
Browse files Browse the repository at this point in the history
…undefined" [packages-only]
  • Loading branch information
Remi749 committed Nov 6, 2024
1 parent 5224d46 commit 2775444
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 2775444

Please sign in to comment.