diff --git a/frameworks/libs/distributeddb/storage/src/sqlite/sqlite_single_ver_natural_store_connection.cpp b/frameworks/libs/distributeddb/storage/src/sqlite/sqlite_single_ver_natural_store_connection.cpp index 45072d6ba57228a56ccec82262bbe342d2e84e4f..ad4c1d3f7476240beb93fe6a3a76f88d97c17369 100644 --- a/frameworks/libs/distributeddb/storage/src/sqlite/sqlite_single_ver_natural_store_connection.cpp +++ b/frameworks/libs/distributeddb/storage/src/sqlite/sqlite_single_ver_natural_store_connection.cpp @@ -1271,6 +1271,11 @@ int SQLiteSingleVerNaturalStoreConnection::StartTransactionInCacheMode(TransactT int SQLiteSingleVerNaturalStoreConnection::StartTransactionNormally(TransactType transType) { + SQLiteSingleVerNaturalStore *naturalStore = GetDB(); + if (naturalStore == nullptr) { + return -E_INVALID_DB; + } + (void)naturalStore->GetTimestamp(); // Get timestamp to trigger start syncer if it need int errCode = E_OK; SQLiteSingleVerStorageExecutor *handle = GetExecutor(true, errCode); if (handle == nullptr) {