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) (#1280)

(cherry picked from commit 7ce8ee4)

Co-authored-by: Andrew Azores <[email protected]>
  • Loading branch information
mergify[bot] and andrewazores authored Jun 11, 2024
1 parent 6abb150 commit e969457
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 e969457

Please sign in to comment.