Crash fixes

This commit is contained in:
KimLS 2014-08-28 03:17:47 -07:00
parent 6597967acd
commit 19271f90a4
2 changed files with 9 additions and 2 deletions

View File

@ -81,8 +81,10 @@ void ExportSpells(SharedDatabase *db) {
line.push_back('^'); line.push_back('^');
} }
if(row[i] != nullptr) {
line += row[i]; line += row[i];
} }
}
fprintf(f, "%s\n", line.c_str()); fprintf(f, "%s\n", line.c_str());
} }
@ -180,8 +182,10 @@ void ExportBaseData(SharedDatabase *db) {
if(rowIndex != 0) if(rowIndex != 0)
line.push_back('^'); line.push_back('^');
if(row[rowIndex] != nullptr) {
line += row[rowIndex]; line += row[rowIndex];
} }
}
fprintf(f, "%s\n", line.c_str()); fprintf(f, "%s\n", line.c_str());
} }

View File

@ -161,6 +161,9 @@ uint32 Database::CheckLogin(const char* name, const char* password, int16* oStat
return 0; return 0;
} }
if(results.RowCount() < 1)
return 0;
auto row = results.begin(); auto row = results.begin();
uint32 id = atoi(row[0]); uint32 id = atoi(row[0]);