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

@Shared crashes app #3030

Closed
2 of 3 tasks
K3TZR opened this issue Apr 30, 2024 · 0 comments · Fixed by #3035
Closed
2 of 3 tasks

@Shared crashes app #3030

K3TZR opened this issue Apr 30, 2024 · 0 comments · Fixed by #3035
Labels
bug Something isn't working due to a bug in the library.

Comments

@K3TZR
Copy link

K3TZR commented Apr 30, 2024

Description

Using 1.10.1 If I add the following to my State my app compiles but crashes at runtime

@Shared(.appStorage("testNil")) var testNil :String? = nil

In general, any optional String with a nil initial value causes a crash

Checklist

  • I have determined whether this bug is also reproducible in a vanilla SwiftUI project.
  • If possible, I've reproduced the issue using the main branch of this package.
  • This issue hasn't been addressed in an existing GitHub issue or discussion.

Expected behavior

No crash

Actual behavior

Screenshot 2024-04-29 at 23 40 32

Steps to reproduce

  1. just add this line to State
    @shared(.appStorage("testNil")) var testNil :String? = nil

The Composable Architecture version information

1.10.1

Destination operating system

macOS 14.4.1

Xcode version information

15.3

Swift Compiler version information

swift-driver version: 1.90.11.1 Apple Swift version 5.10 (swiftlang-5.10.0.13 clang-1500.3.9.4)
Target: arm64-apple-macosx14.0
@K3TZR K3TZR added the bug Something isn't working due to a bug in the library. label Apr 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working due to a bug in the library.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant