[FIX] Fixed crash on null string creation

This commit is contained in:
Adam Dobrowolski
2019-12-16 10:51:42 +01:00
committed by pholat
parent 8c768bbd22
commit efccb4e1ce
2 changed files with 13 additions and 2 deletions

View File

@@ -156,7 +156,14 @@ int Database::queryCallback(void *usrPtr, int count, char **data, char **columns
std::vector<Field> row;
for (uint32_t i = 0; i < (uint32_t)count; i++)
{
row.push_back(Field{data[i]});
try
{
row.push_back(Field{data[i]});
}
catch (...)
{
LOG_FATAL("Error on: %d %s", i, data[i]);
}
}
db->AddRow(row);

View File

@@ -21,8 +21,12 @@ class Field
{
}
Field(const char *value) : mValue(value)
Field(const char *value)
{
if (value)
{
mValue = value;
}
}
// Field(Field const&);