swift-snapshot-testing
swift-snapshot-testing copied to clipboard
Occasionally getting error "SnapshotTesting/UIImage.swift:24: Fatal error: Unexpectedly found nil while unwrapping an Optional value"
Occasionally getting an error on CI
SnapshotTesting/UIImage.swift:24: Fatal error: Unexpectedly found nil while unwrapping an Optional value
This is referring to a line here: https://github.com/pointfreeco/swift-snapshot-testing/blob/main/Sources/SnapshotTesting/Snapshotting/UIImage.swift
Which has some force unwraps.
I'm not sure why this is happening — possibly not even related to this repo.
But instead of force unwrapping and leading to a fatal error, this could presumably be handled more gracefully instead.
Hello @simondelphia, I got the same error, please check if *.png files are ok, in my case my was corrupted.
Yes they are corrupted. The cause of my issue has nothing to do with this library, so I didn't get into the details. Just would be nice if the library failed more gracefully.
@simondelphia But do you know how you resolved this issue?