Skip to content

Commit 9b9f2e6

Browse files
committed
Merge pull request #442 from FrainL/master
Prevent from crash when lastInsertRowId is negative
2 parents c36ef12 + b0322df commit 9b9f2e6

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)