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

fatalError in method interruptibleAnimator #641

Closed
LevinIvan opened this issue Aug 2, 2024 · 2 comments
Closed

fatalError in method interruptibleAnimator #641

LevinIvan opened this issue Aug 2, 2024 · 2 comments

Comments

@LevinIvan
Copy link
Contributor

LevinIvan commented Aug 2, 2024

Description

Hi. In our company, we use FloatingPanel and our users experience a crash in Transitioning.swift:122

    func transitionDuration(using transitionContext: UIViewControllerContextTransitioning?) -> TimeInterval {
        guard
            let fpc = transitionContext?.viewController(forKey: .from) as? FloatingPanelController
        else { fatalError()} // here

        let animator = fpc.animatorForDismissing(with: .zero)
        return TimeInterval(animator.duration)
    }

Unfortunately, we cannot catch this bug and understand what is happening. We have tried to reproduce it in various ways.

I would like to ask two questions:

  1. Why do you call fatalError()? It seems to me too dangerous to use fatal Error in production :(
  2. Is it possible to remove fatalError() and return, for example, 0.0?

I would appreciate your prompt response. 🙏

Expected behavior

  • Do not crash the application, but return some value/error.

Actual behavior

  • The application crashes.

Environment

Library version

  • 2.5.5

Installation method

  • Swift Package Manager

iOS version(s)

  • Any

Xcode version

  • 15.10.0
@LevinIvan
Copy link
Contributor Author

@scenee

@scenee
Copy link
Owner

scenee commented Aug 5, 2024

This issue has been resolved in #642. Thanks

@scenee scenee closed this as completed Aug 5, 2024
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