Skip to content

Commit

Permalink
Remove assertions that prevent error to be thrown up to the user
Browse files Browse the repository at this point in the history
Fixes #1512
  • Loading branch information
groue committed Mar 20, 2024
1 parent 5413dcf commit f8015d9
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions GRDB/Record/FetchableRecord+Decodable.swift
Expand Up @@ -602,14 +602,12 @@ extension DatabaseDataDecodingStrategy {
}
}

/// - precondition: value is not NULL
fileprivate func decode(
fromStatement sqliteStatement: SQLiteStatement,
atUncheckedIndex index: CInt,
context: @autoclosure () -> RowDecodingContext)
throws -> Data
{
assert(sqlite3_column_type(sqliteStatement, index) != SQLITE_NULL, "unexpected NULL value")
switch self {
case .deferredToData:
return Data(sqliteStatement: sqliteStatement, index: index)
Expand Down Expand Up @@ -701,14 +699,12 @@ extension DatabaseDateDecodingStrategy {
}
}

/// - precondition: value is not NULL
fileprivate func decode(
fromStatement sqliteStatement: SQLiteStatement,
atUncheckedIndex index: CInt,
context: @autoclosure () -> RowDecodingContext)
throws -> Date
{
assert(sqlite3_column_type(sqliteStatement, index) != SQLITE_NULL, "unexpected NULL value")
switch self {
case .deferredToDate:
guard let date = Date(sqliteStatement: sqliteStatement, index: index) else {
Expand Down

0 comments on commit f8015d9

Please sign in to comment.