diff --git a/client_files/export/main.cpp b/client_files/export/main.cpp index c4faa4718..e9b127aad 100644 --- a/client_files/export/main.cpp +++ b/client_files/export/main.cpp @@ -81,7 +81,9 @@ void ExportSpells(SharedDatabase *db) { line.push_back('^'); } - line += row[i]; + if(row[i] != nullptr) { + line += row[i]; + } } fprintf(f, "%s\n", line.c_str()); @@ -180,7 +182,9 @@ void ExportBaseData(SharedDatabase *db) { if(rowIndex != 0) line.push_back('^'); - line += row[rowIndex]; + if(row[rowIndex] != nullptr) { + line += row[rowIndex]; + } } fprintf(f, "%s\n", line.c_str()); diff --git a/common/database.cpp b/common/database.cpp index 8d27d5b46..0787f396a 100644 --- a/common/database.cpp +++ b/common/database.cpp @@ -161,6 +161,9 @@ uint32 Database::CheckLogin(const char* name, const char* password, int16* oStat return 0; } + if(results.RowCount() < 1) + return 0; + auto row = results.begin(); uint32 id = atoi(row[0]);