Skip to content

Commit 2afea6e

Browse files
authored
fix(protocol-designer): null protection when opening a step after a t… (#19026)
…imeline error closes AUTH-2149
1 parent c4aeade commit 2afea6e

File tree

1 file changed

+6
-3
lines changed
  • protocol-designer/src/pages/Designer

1 file changed

+6
-3
lines changed

protocol-designer/src/pages/Designer/utils.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -246,8 +246,11 @@ const getNickname = (
246246
t: any
247247
): string => {
248248
const { modules } = activeDeckSetup
249-
const stack = activeDeckSetup.labware[labwareId].stack
250-
const latestSlot = resolveSlotLocation(modules, stack, robotType)
249+
const stack = activeDeckSetup.labware[labwareId]?.stack
250+
const latestSlot =
251+
stack != null
252+
? resolveSlotLocation(modules, stack, robotType)
253+
: 'unknown slot'
251254
const name = nicknamesById[labwareId]
252255
let nickName: string = name
253256
if (latestSlot != null && latestSlot !== 'offDeck') {
@@ -275,7 +278,7 @@ export const useLabwareDropdownOptions = (
275278
labwareId: string
276279
): DropdownOption[] => {
277280
const deckSlot = getSlotInLocationStack(
278-
activeDeckSetup.labware[labwareId].stack
281+
activeDeckSetup.labware[labwareId]?.stack
279282
)
280283
const isLabwareInWasteChute = deckSlot === 'gripperWasteChute'
281284

0 commit comments

Comments
 (0)