extensions/clientprefs/cookie.cpp
changeset 2373 01dd8a057823
parent 2207 3a97a56ded62
child 2380 422da6951d47
     1.1 --- a/extensions/clientprefs/cookie.cpp	Sun Oct 19 22:57:28 2008 -0700
     1.2 +++ b/extensions/clientprefs/cookie.cpp	Mon Oct 20 03:40:46 2008 -0500
     1.3 @@ -263,21 +263,21 @@
     1.4  
     1.5  void CookieManager::ClientConnectCallback(int client, IQuery *data)
     1.6  {
     1.7 -	IResultSet *results = data->GetResultSet();
     1.8 -	if (results == NULL)
     1.9 +	IResultSet *results;
    1.10 +
    1.11 +	if (data == NULL || (results = data->GetResultSet()) == NULL)
    1.12  	{
    1.13  		return;
    1.14  	}
    1.15  
    1.16 +	IResultRow *row;
    1.17  	do
    1.18  	{
    1.19 -		IResultRow *row = results->FetchRow();
    1.20 -
    1.21 -		if (row == NULL)
    1.22 +		if ((row = results->FetchRow()) == NULL)
    1.23  		{
    1.24 -			continue;
    1.25 +			break;
    1.26  		}
    1.27 -		
    1.28 +
    1.29  		const char *name;
    1.30  		row->GetString(0, &name, NULL);
    1.31  
    1.32 @@ -307,7 +307,7 @@
    1.33  
    1.34  		clientData[client].push_back(pData);
    1.35  
    1.36 -	}  while (results->MoreRows());
    1.37 +	} while (results->MoreRows());
    1.38  
    1.39  	statsLoaded[client] = true;
    1.40  
    1.41 @@ -331,8 +331,9 @@
    1.42  
    1.43  void CookieManager::SelectIdCallback(Cookie *pCookie, IQuery *data)
    1.44  {
    1.45 -	IResultSet *results = data->GetResultSet();
    1.46 -	if (results == NULL)
    1.47 +	IResultSet *results;
    1.48 +	
    1.49 +	if (data == NULL || (results = data->GetResultSet()) == NULL)
    1.50  	{
    1.51  		return;
    1.52  	}
    1.53 @@ -400,3 +401,4 @@
    1.54  		}		
    1.55  	}
    1.56  }
    1.57 +