[epiphany/wip/exalm/extensions-cleanup: 2/3] extension-manager: Make sure g_slist_find_custom() doesn't return null




commit ef485fcbe5aa12ec504630070e4fe2023f0dc808
Author: Alexander Mikhaylenko <alexm gnome org>
Date:   Sun Oct 9 19:44:18 2022 +0400

    extension-manager: Make sure g_slist_find_custom() doesn't return null

 src/webextension/ephy-web-extension-manager.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/src/webextension/ephy-web-extension-manager.c b/src/webextension/ephy-web-extension-manager.c
index fe4b8e0eb..6117dfa07 100644
--- a/src/webextension/ephy-web-extension-manager.c
+++ b/src/webextension/ephy-web-extension-manager.c
@@ -1434,12 +1434,16 @@ ephy_web_extension_manager_activate_browser_action (EphyWebExtensionManager *sel
                                                     EphyWebExtension        *web_extension,
                                                     EphyWindow              *window)
 {
-  GSList *table;
+  GSList *table, *l;
   GtkWidget *button;
 
   table = g_hash_table_lookup (self->browser_action_map, web_extension);
   if (table) {
-    button = g_slist_find_custom (table, window, get_browser_action_for_window)->data;
+    l = g_slist_find_custom (table, window, get_browser_action_for_window);
+
+    g_assert (l && l->data);
+
+    button = l->data;
     gtk_widget_mnemonic_activate (button, FALSE);
   }
 }


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