Skip to content

Commit 4145b89

Browse files
SharglutDevyounesschrifi
authored andcommitted
front: fix app crashing when power restriction undefined in train sch… (#4107)
…edule close #4105
1 parent 1965092 commit 4145b89

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

front/src/applications/operationalStudies/components/ManageTrainSchedule/PowerRestrictionSelector.tsx

+3-1
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,9 @@ export default function PowerRestrictionSelector() {
139139
options={powerRestrictions}
140140
onChange={(e: selectorOption) => definePowerRestrictionRange(e.key)}
141141
selectedValue={
142-
(powerRestriction && powerRestriction[0].power_restriction_code) ||
142+
(powerRestriction &&
143+
powerRestriction[0] &&
144+
powerRestriction[0].power_restriction_code) ||
143145
t('noPowerRestriction')
144146
}
145147
/>

0 commit comments

Comments
 (0)