Skip to content

Commit 310f60a

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 f159ad2 commit 310f60a

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
@@ -1647,7 +1647,6 @@ static int xConflict(void* pCtx, int eConflict, sqlite3_changeset_iter* pIter) {
16471647

16481648
static int xFilter(void* pCtx, const char* zTab) {
16491649
auto ctx = static_cast<ConflictCallbackContext*>(pCtx);
1650-
if (!ctx->filterCallback) return 1;
16511650
return ctx->filterCallback(zTab) ? 1 : 0;
16521651
}
16531652

@@ -1751,7 +1750,7 @@ void DatabaseSync::ApplyChangeset(const FunctionCallbackInfo<Value>& args) {
17511750
db->connection_,
17521751
buf.length(),
17531752
const_cast<void*>(static_cast<const void*>(buf.data())),
1754-
xFilter,
1753+
context.filterCallback ? xFilter : nullptr,
17551754
xConflict,
17561755
static_cast<void*>(&context));
17571756
if (r == SQLITE_OK) {

0 commit comments

Comments
 (0)