You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 !.
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
changed the title
fix: Properly unwrap optional data values in ShapeValueGenerator.kt
fix: Properly unwrap optional data values
Nov 6, 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
The text was updated successfully, but these errors were encountered: