Skip to content

Commit

Permalink
fix(matchexpr): tooltip hint checks for annotation existence before a…
Browse files Browse the repository at this point in the history
…sserting value (#1275)

* fix(matchexpr): tooltip hint checks for annotation existence before asserting value

* formatting

(cherry picked from commit 7ce8ee4)
  • Loading branch information
andrewazores authored and mergify[bot] committed Jun 11, 2024
1 parent 6abb150 commit fdc5a34
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,12 @@ export const MatchExpressionHint: React.FC<MatchExpressionHintProps> = ({ 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);
Expand Down

0 comments on commit fdc5a34

Please sign in to comment.