mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2024-12-27 09:58:45 +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 );
|
||||
int nTuples = PQntuples( result );
|
||||
assert( nTuples <= 1 );
|
||||
bool full = 't' == PQgetvalue( result, 0, 0 )[0];
|
||||
bool full = nTuples == 1 && 't' == PQgetvalue( result, 0, 0 )[0];
|
||||
PQclear( result );
|
||||
logf( XW_LOGINFO, "%s=>%d", __func__, full );
|
||||
return full;
|
||||
|
|
Loading…
Reference in a new issue