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
I've tried to reproduce the crash by hardcoding these values, but that didn't reproduce the crash. I've also made sure that the cgImage and Colorspace are non nil:
guard let cgImage = image.cgImage else{throwNSError(domain:"Toucan", code:-1, userInfo:[NSLocalizedDescriptionKey:"CGImage is nil"])}
guard let colorSpace = cgImage.colorSpace else{throwNSError(domain:"Toucan", code:-2, userInfo:[NSLocalizedDescriptionKey:"Color space is nil"])}
We've never seen these being logged.
Next steps
We for now prevented this crash from happening again by adding guards and throws instead of force unwrapping. It would be great if we can find the cause of this crash and fix it instead.
The text was updated successfully, but these errors were encountered:
Hi @AvdLee, I've been trying to reproduce this without much luck. Indeed, like you said, adding a guard for CGContext failing would silently fix the issue, but I'm interested in getting to the root cause, otherwise you'd end up with empty images (which isn't great).
Do you have any sample images on which this fails with? Another possibility is if it's being used on a table cell that's being reaped? There was a recent PR merged (#68) to fix those types of issues.
Hi @gavinbunney, thanks for taking the time to look into this.
Unfortunately, we didn't have any images reproducing this issue. On top of that, we're no longer using Toucan so this issue is no longer causing any issues on our side. This makes it hard to give any additional information on whether it's fixed or still occurring.
Let me know if you have any other questions and I see what I can do.
We currently expire crashes in our app, which we "fixed" by removing force unwraps and adding logging to get more insights.
Crashlog
Device and system information
iOS 10 and iOS 11
iPad and iPhone
Known stats from logging
The crash is happening on this line which force unwraps the
CGContext
. It seems that scenarios exist in which the created context isnil
.After adding a guard and logging in the return statement, we've seen logs like this:
I've tried to reproduce the crash by hardcoding these values, but that didn't reproduce the crash. I've also made sure that the cgImage and Colorspace are non nil:
We've never seen these being logged.
Next steps
We for now prevented this crash from happening again by adding guards and throws instead of force unwrapping. It would be great if we can find the cause of this crash and fix it instead.
The text was updated successfully, but these errors were encountered: