Skip to content

Commit

Permalink
add fail safe for widget layout prop (#2138)
Browse files Browse the repository at this point in the history
  • Loading branch information
CollinBeczak authored Oct 19, 2023
1 parent 095cfd9 commit 8bec650
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/services/Challenge/Challenge.js
Original file line number Diff line number Diff line change
Expand Up @@ -963,7 +963,7 @@ export const fetchChallenges = function (

// If there is local JSON content being transmitted as a string, parse
// it into JSON first.
if (!challengeData.taskWidgetLayout.workspace && challengeData.taskWidgetLayout) {
if (!challengeData.taskWidgetLayout?.workspace && challengeData.taskWidgetLayout) {
try {
if (!(JSON.parse(challengeData.taskWidgetLayout).workspace.name === "taskCompletion")) {
throw new Error("Widget layout for task completion flow with the wrong format was submitted, it was not included in the save.")
Expand Down

0 comments on commit 8bec650

Please sign in to comment.