diff --git a/module-db/Database/Database.cpp b/module-db/Database/Database.cpp index 368b70e55..55ca9e5d1 100644 --- a/module-db/Database/Database.cpp +++ b/module-db/Database/Database.cpp @@ -156,7 +156,14 @@ int Database::queryCallback(void *usrPtr, int count, char **data, char **columns std::vector 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); diff --git a/module-db/Database/Field.hpp b/module-db/Database/Field.hpp index 6998a8af7..7b2183343 100644 --- a/module-db/Database/Field.hpp +++ b/module-db/Database/Field.hpp @@ -21,8 +21,12 @@ class Field { } - Field(const char *value) : mValue(value) + Field(const char *value) { + if (value) + { + mValue = value; + } } // Field(Field const&);