Skip to content

Commit c85fe38

Browse files
author
FrainL
committed
prevent from crash when lastInsertRowId is negative
1 parent 76fb35d commit c85fe38

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

SQLite/Core/Connection.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ public final class Connection {
107107
/// The last rowid inserted into the database via this connection.
108108
public var lastInsertRowid: Int64? {
109109
let rowid = sqlite3_last_insert_rowid(handle)
110-
return rowid > 0 ? rowid : nil
110+
return rowid != 0 ? rowid : nil
111111
}
112112

113113
/// The last number of changes (inserts, updates, or deletes) made to the

0 commit comments

Comments
 (0)