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);