Skip to content
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

Check that snapshot.Status is not nil when checking Status properties. #4021

Merged

Conversation

dsessler7
Copy link
Contributor

@dsessler7 dsessler7 commented Oct 28, 2024

Checklist:

  • Have you added an explanation of what your changes do and why you'd like them to be included?
  • Have you updated or added documentation for the change, as applicable?
  • Have you tested your changes on all related environments with successful results, as applicable?
    • Have you added automated tests?

Type of Changes:

  • New feature
  • Bug fix
  • Documentation
  • Testing enhancement
  • Other

What is the current behavior (link to any open issues here)?

We currently don't check that a snapshot's Status isn't nil when checking Status properties. There is an edge case where a snapshot does not yet have a Status which can lead to a nil pointer dereference.

What is the new behavior (if this is a feature change)?

  • Breaking change (fix or feature that would cause existing functionality to change)

We now check for the existence of snapshot.Status when checking a snapshot's Status properties.

Other Information:

Copy link
Contributor

@tjmoore4 tjmoore4 left a comment

Choose a reason for hiding this comment

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

❓ These changes look good, but is there some way we can update our tests for this scenario?

@dsessler7 dsessler7 force-pushed the fix_get_latest_ready_snapshots branch from 9aec3b0 to 6315325 Compare October 29, 2024 17:00
@dsessler7 dsessler7 requested a review from tjmoore4 October 29, 2024 17:00
@dsessler7
Copy link
Contributor Author

Added a couple tests for the altered functions.

Copy link
Contributor

@tjmoore4 tjmoore4 left a comment

Choose a reason for hiding this comment

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

👍 Looks good

@dsessler7 dsessler7 merged commit 0f21106 into CrunchyData:master Oct 29, 2024
13 of 14 checks passed
@dsessler7 dsessler7 deleted the fix_get_latest_ready_snapshots branch October 29, 2024 18:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants