Skip to content

Commit 30508c4

Browse files
Report exception as unknown error when SQLite does not report an error
1 parent 1a8b882 commit 30508c4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

android-database-sqlcipher/src/main/cpp/net_sqlcipher_database_SQLiteDatabase.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -602,7 +602,7 @@ namespace sqlcipher {
602602
concatenated with the given message
603603
*/
604604
void throw_sqlite3_exception(JNIEnv* env, sqlite3* handle, const char* message) {
605-
if (handle) {
605+
if (handle && sqlite3_errcode(handle) != SQLITE_OK) {
606606
throw_sqlite3_exception(env, sqlite3_errcode(handle),
607607
sqlite3_errmsg(handle), message);
608608
} else {

0 commit comments

Comments
 (0)