mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-30 16:05:51 +00:00
Fix 'getStr' to not crash on a non-existent column.
This commit is contained in:
@@ -179,8 +179,9 @@ bool SqliteDatabase::getNull(int colIndex)
|
|||||||
|
|
||||||
char* SqliteDatabase::getStr(int colIndex,std::string& retStr)
|
char* SqliteDatabase::getStr(int colIndex,std::string& retStr)
|
||||||
{
|
{
|
||||||
retStr=(char*)sqlite3_column_text(mCurrentStmt, colIndex);
|
const char *text = reinterpret_cast<const char *>(sqlite3_column_text(mCurrentStmt, colIndex));
|
||||||
return((char*)retStr.c_str());
|
retStr = (text == NULL) ? "" : text;
|
||||||
|
return const_cast<char*>(retStr.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
int32 SqliteDatabase::getInt(int colIndex)
|
int32 SqliteDatabase::getInt(int colIndex)
|
||||||
|
|||||||
Reference in New Issue
Block a user