Skip to content

Commit c980105

Browse files
aduh95juanarbol
authored andcommitted
src,sqlite: only pass xFilter when user provided a callback
Signed-off-by: Antoine du Hamel <duhamelantoine1995@gmail.com> PR-URL: #63516 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: René <contact.9a5d6388@renegade334.me.uk> Reviewed-By: Edy Silva <edigleyssonsilva@gmail.com>
1 parent 127a4ee commit c980105

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

src/node_sqlite.cc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1751,7 +1751,6 @@ static int xConflict(void* pCtx, int eConflict, sqlite3_changeset_iter* pIter) {
17511751

17521752
static int xFilter(void* pCtx, const char* zTab) {
17531753
auto ctx = static_cast<ConflictCallbackContext*>(pCtx);
1754-
if (!ctx->filterCallback) return 1;
17551754
return ctx->filterCallback(zTab) ? 1 : 0;
17561755
}
17571756

@@ -1855,7 +1854,7 @@ void DatabaseSync::ApplyChangeset(const FunctionCallbackInfo<Value>& args) {
18551854
db->connection_,
18561855
buf.length(),
18571856
const_cast<void*>(static_cast<const void*>(buf.data())),
1858-
xFilter,
1857+
context.filterCallback ? xFilter : nullptr,
18591858
xConflict,
18601859
static_cast<void*>(&context));
18611860
if (r == SQLITE_OK) {

0 commit comments

Comments
 (0)