Skip to content

Commit

Permalink
[core] Allow db::extractBlob to handle null blobs
Browse files Browse the repository at this point in the history
  • Loading branch information
zach2good committed Dec 19, 2023
1 parent 3bca4a1 commit da01ba4
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/common/database.h
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,14 @@ namespace db
template <typename T>
void extractBlob(std::unique_ptr<sql::ResultSet>& rset, std::string const& blobKey, T* destination)
{
TracyZoneScoped;

std::unique_ptr<std::istream> inStr(rset->getBlob(blobKey.c_str()));
if (!inStr)
{
std::memset(destination, 0x00, sizeof(T));
return;
}

char buff[sizeof(T)];
while (!inStr->eof())
Expand Down

0 comments on commit da01ba4

Please sign in to comment.