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

Why do you use force unwrap? Don't you know it's a bad practice? #542

Closed
MadGeorge opened this issue May 30, 2022 · 1 comment
Closed

Why do you use force unwrap? Don't you know it's a bad practice? #542

MadGeorge opened this issue May 30, 2022 · 1 comment

Comments

@MadGeorge
Copy link

Screenshot 2022-05-30 at 15 30 38

@scenee
Copy link
Owner

scenee commented May 31, 2022

Of course, I know. But there is nothing I can do to escape that fpc.transitionAnimator is implicitly unwrapped optional because it's easy to lead a mistake in the core logic and make the core logic simple. In addition, it's not possible fpc. transitionAnimator is nil in most cases.

I assume this crash happens when fpc.state is not .hidden before calling fpc.show(animated: true). It was not expected to present a panel from any state except for .hidden. Thanks to your report, I could know it happened on an occasion.

I wrote a patch to prevent a crash for that case in prevent-force-unwrapping-crash branch. It ensures that the initial state is hidden before presenting a panel. So I hope would you try it and give me a feedback.

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

No branches or pull requests

2 participants