Commit 224f7b89 authored by David Zeuthen's avatar David Zeuthen

Make polkit_details_insert() remove the key if passed value is NULL

Signed-off-by: default avatarDavid Zeuthen <davidz@redhat.com>
parent 13ac4693
......@@ -142,6 +142,8 @@ polkit_details_lookup (PolkitDetails *details,
* @value: (allow-none): A value.
*
* Inserts a copy of @key and @value on @details.
*
* If @value is %NULL, the key will be removed.
*/
void
polkit_details_insert (PolkitDetails *details,
......@@ -155,7 +157,10 @@ polkit_details_insert (PolkitDetails *details,
g_str_equal,
g_free,
g_free);
if (value != NULL)
g_hash_table_insert (details->hash, g_strdup (key), g_strdup (value));
else
g_hash_table_remove (details->hash, key);
}
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment