1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-29 08:01:23 +03:00

JNI: correct a NullPointerException triggered via SQLTester.

FossilOrigin-Name: 0a873de76c0cbcd8e2eda3f0508e427f1dcb32b01798687c0545acfe10102179
This commit is contained in:
stephan
2023-09-28 20:34:28 +00:00
parent 0dabcd139d
commit 83f62816f8
3 changed files with 13 additions and 10 deletions

View File

@ -574,8 +574,11 @@ public final class SQLite3Jni {
@Canonical
public static int sqlite3_close(@Nullable sqlite3 db){
final int rc = sqlite3_close(db.getNativePointer());
if( 0==rc ) db.clearNativePointer();
int rc = 0;
if( null!=db ){
rc = sqlite3_close(db.getNativePointer());
if( 0==rc ) db.clearNativePointer();
}
return rc;
}
@ -584,7 +587,7 @@ public final class SQLite3Jni {
@Canonical
public static int sqlite3_close_v2(@Nullable sqlite3 db){
return sqlite3_close_v2(db.clearNativePointer());
return db==null ? 0 : sqlite3_close_v2(db.clearNativePointer());
}
@Canonical