Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion web/packages/teleport/src/services/joinToken/joinToken.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ class JoinTokenService {
fetchJoinTokens(signal: AbortSignal = null): Promise<{ items: JoinToken[] }> {
return api.get(cfg.getJoinTokensUrl(), signal).then(resp => {
return {
items: resp.items.map(makeJoinToken),
items: resp.items?.map(makeJoinToken) || [],
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the API endpoint not include items when there are no items to return?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It includes it, but it's null:
image

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like it has to do with not using zero-length slices.

};
});
}
Expand Down