stephencelis / SQLite.swift

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

Fix #1247 support nil case when decoding optionals #1248

Closed Chris-Stockbridge closed 3 months ago

Chris-Stockbridge commented 3 months ago

1247 describes a bug where decoding a nil value in an optional throws an error when nil is a valid response.

This same bug occurs with arrays or structs encoded to either optional string or data types.

Testing

I added a unit test "test_insert_custom_encodable_type" which demonstrates the issue. The current master branch fails when decoding a nil value.