mirror of
https://github.com/mudita/MuditaOS.git
synced 2026-05-18 21:54:11 -04:00
[FIX] Fixed crash on null string creation
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -21,8 +21,12 @@ class Field
|
||||
{
|
||||
}
|
||||
|
||||
Field(const char *value) : mValue(value)
|
||||
Field(const char *value)
|
||||
{
|
||||
if (value)
|
||||
{
|
||||
mValue = value;
|
||||
}
|
||||
}
|
||||
// Field(Field const&);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user