mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-15 15:41:24 +01:00
fix rare crash: don't call PQgetvalue when there are no results.
This commit is contained in:
parent
5c5708fa66
commit
09b81c6ad7
1 changed files with 1 additions and 1 deletions
|
@ -229,7 +229,7 @@ DBMgr::AllDevsAckd( const char* const connName )
|
||||||
PGresult* result = PQexec( getThreadConn(), query );
|
PGresult* result = PQexec( getThreadConn(), query );
|
||||||
int nTuples = PQntuples( result );
|
int nTuples = PQntuples( result );
|
||||||
assert( nTuples <= 1 );
|
assert( nTuples <= 1 );
|
||||||
bool full = 't' == PQgetvalue( result, 0, 0 )[0];
|
bool full = nTuples == 1 && 't' == PQgetvalue( result, 0, 0 )[0];
|
||||||
PQclear( result );
|
PQclear( result );
|
||||||
logf( XW_LOGINFO, "%s=>%d", __func__, full );
|
logf( XW_LOGINFO, "%s=>%d", __func__, full );
|
||||||
return full;
|
return full;
|
||||||
|
|
Loading…
Reference in a new issue