accept NULL values in hashtable enumerator

This commit is contained in:
Martin Willi
2008-12-05 12:34:17 +00:00
parent 19e0010f51
commit d21b3549f7
+6
View File
@@ -331,9 +331,15 @@ static bool enumerate(private_enumerator_t *this, void **key, void **value)
pair_t *pair; pair_t *pair;
if (this->current->enumerate(this->current, &pair)) if (this->current->enumerate(this->current, &pair))
{
if (key)
{ {
*key = pair->key; *key = pair->key;
}
if (value)
{
*value = pair->value; *value = pair->value;
}
return TRUE; return TRUE;
} }
this->current->destroy(this->current); this->current->destroy(this->current);