Skip to content

Commit b35cfea

Browse files
Remove error on starting batch accessibility map
We had this error when we started a new batch accessiblity map calculation: TypeError: Cannot read properties of undefined (reading 'errors') Change is to use optional chaining and provides an empty array as fallback for errors and warnings which might not be yet present in the routingResult when we just create the job.
1 parent b440e2c commit b35cfea

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/transition-frontend/src/components/forms/accessibilityMap/AccessibilityMapBatchForm.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,8 +173,8 @@ class AccessibilityMapBatchForm extends ChangeEventsForm<
173173
const routingResult: any = await BatchAccessibilityMapCalculator.calculate(this.state.object);
174174
this.setState({
175175
batchRoutingInProgress: false,
176-
errors: routingResult.errors,
177-
warnings: routingResult.warnings
176+
errors: routingResult?.errors ?? [],
177+
warnings: routingResult?.warnings ?? []
178178
});
179179
} catch (error) {
180180
this.setState({

0 commit comments

Comments
 (0)