From e96945761549960e1616fe7c7de6bda220b96bf6 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Tue, 11 Jun 2024 14:18:39 -0400 Subject: [PATCH] fix(matchexpr): tooltip hint checks for annotation existence before asserting value (#1275) (#1280) (cherry picked from commit 7ce8ee4e463d08eff750660abea9c49a15fc2937) Co-authored-by: Andrew Azores --- .../Components/MatchExpression/MatchExpressionHint.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/app/Shared/Components/MatchExpression/MatchExpressionHint.tsx b/src/app/Shared/Components/MatchExpression/MatchExpressionHint.tsx index d219fbab2..c228beb6e 100644 --- a/src/app/Shared/Components/MatchExpression/MatchExpressionHint.tsx +++ b/src/app/Shared/Components/MatchExpression/MatchExpressionHint.tsx @@ -31,10 +31,12 @@ export const MatchExpressionHint: React.FC = ({ target if (!target || !target.alias || !target.connectUrl) { body = 'true'; } else { - body = `target.alias == '${target.alias}' || target.annotations.cryostat['PORT'] == ${getAnnotation( + body = `target.alias == '${ + target.alias + }' || ('PORT' in target.annotations.cryostat && target.annotations.cryostat.PORT == ${getAnnotation( target.annotations.cryostat, 'PORT', - )}`; + )})`; } body = JSON.stringify(body, null, 2); body = body.substring(1, body.length - 1);