diff options
author | Alexander Mikhaylenko <alexm@gnome.org> | 2022-10-09 19:44:18 +0400 |
---|---|---|
committer | Marge Bot <marge-bot@gnome.org> | 2022-10-09 16:16:27 +0000 |
commit | 7bceeb11c905ee5463bb89bc778ff588c8cf0faf (patch) | |
tree | 46435a2bb67d386cad901c8994f5fc9ad3dec1c4 | |
parent | 079d327b4ded311288a7428ec1ae17aebeb59225 (diff) | |
download | epiphany-7bceeb11c905ee5463bb89bc778ff588c8cf0faf.tar.gz |
extension-manager: Make sure g_slist_find_custom() doesn't return null
Part-of: <https://gitlab.gnome.org/GNOME/epiphany/-/merge_requests/1198>
-rw-r--r-- | src/webextension/ephy-web-extension-manager.c | 8 |
1 files 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); } } |