Skip to content

Commit

Permalink
fix(storedcredentials): define target match array to avoid undefined …
Browse files Browse the repository at this point in the history
…reference error
  • Loading branch information
andrewazores committed Jan 10, 2025
1 parent 534f939 commit 805972a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/app/SecurityPanel/Credentials/StoredCredentials.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,7 @@ export const StoredCredentials = () => {
map((cred) => ({
id: message.id,
matchExpression: cred.matchExpression,
targets: cred.targets,
numMatchingTargets: cred.targets.length,
})),
);
Expand Down Expand Up @@ -425,7 +426,7 @@ export const StoredCredentials = () => {
<Icon iconSize="md">
<ContainerNodeIcon />
</Icon>
<span style={{ marginLeft: 'var(--pf-v5-global--spacer--sm)' }}>{credential.targets.length}</span>
<span style={{ marginLeft: 'var(--pf-v5-global--spacer--sm)' }}>{credential?.targets?.length ?? 0}</span>
</Button>
</Td>
</Tr>
Expand Down

0 comments on commit 805972a

Please sign in to comment.