Skip to content

Commit

Permalink
Add null check in bpmnHandlerUtils
Browse files Browse the repository at this point in the history
  • Loading branch information
ErlingHauan committed Oct 8, 2024
1 parent 47ee66e commit 935cb6c
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { LayoutSets } from 'app-shared/types/api/LayoutSetsResponse';

export const getLayoutSetIdFromTaskId = (elementId: string, layoutSets: LayoutSets) => {
const layoutSet = layoutSets.sets.find((set) => set.tasks[0] === elementId);
const layoutSet = layoutSets.sets.find((set) => set.tasks && set?.tasks[0] === elementId);
return layoutSet?.id;
};
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export const ConfigContent = (): React.ReactElement => {
<Accordion.Content className={classes.accordion}>
<EditLayoutSetName existingLayoutSetName={layoutSet.id} />
<EditDataTypes
connectedTaskId={layoutSet?.tasks[0]}
connectedTaskId={layoutSet.tasks[0]}
dataModelIds={availableDataModelIds}
existingDataTypeForTask={existingDataTypeForTask}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ export const RecommendedActionChangeName = (): React.ReactElement => {
if (newNameError || newName === '') {
return false;
}

mutateLayoutSetId({ layoutSetIdToUpdate: bpmnDetails.element.id, newLayoutSetId: newName });
removeAction(bpmnDetails.element.id);
};
Expand Down

0 comments on commit 935cb6c

Please sign in to comment.