Skip to content

Commit a6f8b1b

Browse files
committed
fix(network): cloudsync_network_check_changes must not return the nrows value in case of error
`SELECT cloudysnc_network_check_changes();` was returning "Runtime error: 0" in case of error response from the cloudsync microservice instead of the real error message
1 parent ff30ae5 commit a6f8b1b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/network.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -897,10 +897,10 @@ void cloudsync_network_check_changes (sqlite3_context *context, int argc, sqlite
897897
DEBUG_FUNCTION("cloudsync_network_check_changes");
898898

899899
int nrows = 0;
900-
cloudsync_network_check_internal(context, &nrows);
900+
int rc = cloudsync_network_check_internal(context, &nrows);
901901

902902
// returns number of applied rows
903-
sqlite3_result_int(context, nrows);
903+
if (rc == SQLITE_OK) sqlite3_result_int(context, nrows);
904904
}
905905

906906
void cloudsync_network_reset_sync_version (sqlite3_context *context, int argc, sqlite3_value **argv) {

0 commit comments

Comments
 (0)