[gnome-settings-daemon/wip/hadess/fix-media-keys-migration-crash: 2/2] media-keys: Add guard to map_keybinding()



commit cb2b77d3dd89fc486ef9c32aa40f4b6f4581b255
Author: Bastien Nocera <hadess hadess net>
Date:   Sat Nov 16 11:44:55 2019 +0100

    media-keys: Add guard to map_keybinding()
    
    Just in case g_variant_get_strv() returns NULL when it really shouldn't.

 plugins/media-keys/gsd-media-keys-manager.c | 1 +
 1 file changed, 1 insertion(+)
---
diff --git a/plugins/media-keys/gsd-media-keys-manager.c b/plugins/media-keys/gsd-media-keys-manager.c
index 205455ec..4e167c86 100644
--- a/plugins/media-keys/gsd-media-keys-manager.c
+++ b/plugins/media-keys/gsd-media-keys-manager.c
@@ -3202,6 +3202,7 @@ map_keybinding (GVariant *variant, GVariant *old_default, GVariant *new_default)
         const gchar *value;
 
         defaults = g_variant_get_strv (new_default, NULL);
+        g_return_val_if_fail (defaults != NULL, NULL);
         pos = defaults;
 
         value = g_variant_get_string (variant, NULL);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]