-
-
Notifications
You must be signed in to change notification settings - Fork 514
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
Crash in panningEnd
#226
Comments
Thanks for your detailed report! |
Nice, thanks for the fix! Small suggestion: changing this line to an optional would prevent future issues of the same nature. |
I agree with you. I will improve it on |
Small tip for that branch, you can easily chain optionals if there's no need for the unwrapped value. For example: if let vc = viewcontroller {
vc.delegate?.floatingPanelDidChangePosition(vc)
} Becomes: viewcontroller?.delegate?.floatingPanelDidChangePosition(viewcontroller) Same for most of the other changes below, like R176, R224, R326, etc... |
Is it right? The replacement causes the error because
|
Ah, apologies, didn't notice you also needed to have a non-optional argument for the callbacks. In that case the code is indeed correct, you'll need to unwrap it each time. |
Short description
There's a sporadic crash that we're seeing in Fabric (Crashlytics) on this line:
FloatingPanel.swift#L523
We're unable to reproduce it, and it has only happened 9 times for a total of 16k users (up to now).
Expected behavior
It shouldn't crash. 😉
Actual behavior
It crashes at the line mentioned above. From a quick look at the code, it's probably crashing because of the implicitly unwrapped optional (
weak var viewcontroller: FloatingPanelController!
). Changing this to a normal optional would solve the issue, and be much safer in general.Steps to reproduce
No idea, we're only seeing the crash logs:
Environment
Library version
1.6.0
Installation method
iOS version(s)
11 and 12 (we only support those versions in our app)
Xcode version
10.2
The text was updated successfully, but these errors were encountered: