From 489a7e37750ee888a74b85e28ffca237d01b5ecc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1rio=20Bezerra?= Date: Wed, 25 May 2022 17:01:30 -0300 Subject: [PATCH] fix: canary parser when steps is null or empty --- ui/src/index.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ui/src/index.tsx b/ui/src/index.tsx index f802c5d..2a5b653 100644 --- a/ui/src/index.tsx +++ b/ui/src/index.tsx @@ -64,8 +64,8 @@ const parseCurrentCanaryStep = ( ): { currentStep: any; currentStepIndex: number } => { const { status, spec } = resource; const canary = spec.strategy?.canary; - if (!canary || canary.steps.length === 0) { - return null; + if (!canary || !canary.steps || canary.steps.length === 0) { + return { currentStep: null, currentStepIndex: -1 }; } let currentStepIndex = 0; if (status.currentStepIndex) {