stephencelis / SQLite.swift

A type-safe, Swift-language layer over SQLite3.
MIT License
9.67k stars 1.56k forks source link

force unwrap cause crash #956

Closed huahuahu closed 3 years ago

huahuahu commented 4 years ago

Build Information

I found it crashed when reading from a corrupted db file. Is there a way to handle this ?

Here is the message

Fatal error: 'try!' expression unexpectedly raised an error: database disk image is malformed (code: 11): file /Users/larkios/Jenkins/workspace/lark/ios/appcenter/ios-beta-pack/Pods/SQLite.swift/Sources/SQLite/Core/Statement.swift, line 211

image

pandapancake commented 4 years ago

I changed it to optional return try? failableNext(). So far it haven't crush yet.

nathanfallet commented 3 years ago

Fixed by a PR in 0.13.0