From 7ff5e27ead5b96448444c4618bc8f7480b7deffd Mon Sep 17 00:00:00 2001 From: Jethary Alcid <66035149+jerader@users.noreply.github.com> Date: Thu, 12 Dec 2024 12:35:36 -0500 Subject: [PATCH] fix(protocol-designer): resolve console error by adding null protection (#17094) --- .../StepForm/StepTools/MoveLiquidTools/index.tsx | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/protocol-designer/src/pages/Designer/ProtocolSteps/StepForm/StepTools/MoveLiquidTools/index.tsx b/protocol-designer/src/pages/Designer/ProtocolSteps/StepForm/StepTools/MoveLiquidTools/index.tsx index fcb64ff8834..f2c99c24087 100644 --- a/protocol-designer/src/pages/Designer/ProtocolSteps/StepForm/StepTools/MoveLiquidTools/index.tsx +++ b/protocol-designer/src/pages/Designer/ProtocolSteps/StepForm/StepTools/MoveLiquidTools/index.tsx @@ -98,11 +98,14 @@ export function MoveLiquidTools(props: StepFormProps): JSX.Element { additionalEquipmentEntities[String(propsForFields.dispense_labware.value)] ?.name === 'trashBin' - const destinationLabwareType = getTrashOrLabware( - labwares, - additionalEquipmentEntities, - formData.dispense_labware as string - ) + const destinationLabwareType = + formData.dispense_labware != null + ? getTrashOrLabware( + labwares, + additionalEquipmentEntities, + formData.dispense_labware as string + ) + : null const isDestinationTrash = destinationLabwareType != null ? ['trashBin', 'wasteChute'].includes(destinationLabwareType)