Skip to content

Commit

Permalink
Fixed a bug in the SQL library
Browse files Browse the repository at this point in the history
  • Loading branch information
iagaponenko committed Jun 20, 2023
1 parent e503efe commit a0b20e5
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/sql/SqlResults.cc
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,12 @@ bool SqlResults::extractFirstValue(std::string& ret, SqlErrorObject& errObj) {
if (!row) {
return errObj.addErrMsg("Expecting one row, found no rows");
}
ret = (row[0]);
auto ptr = row[0];
if (!ptr) {
freeResults();
return errObj.addErrMsg("NULL returned by the query");
}
ret = ptr;
freeResults();
return true;
}
Expand Down

0 comments on commit a0b20e5

Please sign in to comment.