diff --git a/src/ssb.db.c b/src/ssb.db.c index cac4a60e3..d582c48e5 100644 --- a/src/ssb.db.c +++ b/src/ssb.db.c @@ -2018,8 +2018,9 @@ bool tf_ssb_db_get_global_setting_bool(sqlite3* db, const char* name, bool* out_ { if (sqlite3_bind_text(statement, 1, name, -1, NULL) == SQLITE_OK) { - if (sqlite3_step(statement) == SQLITE_ROW) + if (sqlite3_step(statement) == SQLITE_ROW && sqlite3_column_type(statement, 0) != SQLITE_NULL) { + tf_printf("have row for %s: %d\n", name, sqlite3_column_int(statement, 0)); *out_value = sqlite3_column_int(statement, 0) != 0; result = true; } @@ -2064,7 +2065,7 @@ bool tf_ssb_db_get_global_setting_string(sqlite3* db, const char* name, char* ou { if (sqlite3_bind_text(statement, 1, name, -1, NULL) == SQLITE_OK) { - if (sqlite3_step(statement) == SQLITE_ROW) + if (sqlite3_step(statement) == SQLITE_ROW && sqlite3_column_type(statement, 0) != SQLITE_NULL) { snprintf(out_value, size, "%s", sqlite3_column_text(statement, 0)); result = true;