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

fix: Properly unwrap optional data values #1208

Closed
2 tasks
Tracked by #710
dayaffe opened this issue Oct 30, 2023 · 2 comments
Closed
2 tasks
Tracked by #710

fix: Properly unwrap optional data values #1208

dayaffe opened this issue Oct 30, 2023 · 2 comments
Labels
feature-request A feature should be added or improved.

Comments

@dayaffe
Copy link
Contributor

dayaffe commented Oct 30, 2023

Describe the feature

In ShapeValueGenerator.kt we currently write ".data(using: .utf8)!, isClosed: true))" and ".data(using: .utf8)!". We should properly unwrap .data optional values rather than force them to be non-null using !.

Related comment:
// TODO: properly handle this optional with an unwrapped statement before it's passed as a value to a shape.

Use Case

Forced un-wrapping with ! should be avoided. Un-wrapping using other methods allows us to gracefully/explicitly handle unexpected null values.

Proposed Solution

No response

Other Information

Related issue: #710

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change
@dayaffe dayaffe added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. labels Oct 30, 2023
@dayaffe dayaffe changed the title fix: Properly unwrap optional data values fix: Properly unwrap optional data values in ShapeValueGenerator.kt Oct 30, 2023
@sichanyoo
Copy link
Contributor

sichanyoo commented Nov 6, 2023

This ticket will involve changes that need to be made to all places where force-unwrap is currently done for assumed data type, as well as possibly creating a new error type that should be used for this case.

@sichanyoo sichanyoo changed the title fix: Properly unwrap optional data values in ShapeValueGenerator.kt fix: Properly unwrap optional data values Nov 6, 2023
@sichanyoo sichanyoo added this to the GA milestone Nov 6, 2023
@sichanyoo sichanyoo removed the needs-triage This issue or PR still needs to be triaged. label Nov 6, 2023
@jbelkins jbelkins removed this from the GA milestone May 20, 2024
@jbelkins
Copy link
Contributor

Closing since it is part of ongoing code review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request A feature should be added or improved.
Projects
None yet
Development

No branches or pull requests

3 participants