Skip to content

fix(cli/cliui): handle typed nil and null time in tables #15984

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 31, 2024

Conversation

mafredri
Copy link
Member

@mafredri mafredri commented Dec 31, 2024

This PR fixes an issue where if a nil value of a type that implements fmt.Stringer is used in the table data, we get typed(nil) != nil == true and a nil pointer deref.

Also adds support for codersdk.NullTime.

@mafredri mafredri self-assigned this Dec 31, 2024
Copy link
Member

@mtojek mtojek left a comment

Choose a reason for hiding this comment

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

stamp 👍 ... although I'm wondering if we can add a short golden test file for CLI UI Table.

@mafredri
Copy link
Member Author

@mtojek thanks for the suggestion, noticed there were more bases to cover thanks to the tests 👍🏻

@mafredri mafredri enabled auto-merge (squash) December 31, 2024 14:31
@mafredri mafredri merged commit 23b1c2d into main Dec 31, 2024
30 checks passed
@mafredri mafredri deleted the mafredri/fix-cli-cliui-table-handle-more-types branch December 31, 2024 14:36
@github-actions github-actions bot locked and limited conversation to collaborators Dec 31, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants