[epiphany/pgriffis/web-extension/bitwarden: 4/7] WebExtensions: Fix handling tabs replying to messages early




commit 754d4911175fbceba13ec50887b6dda2ccd93408
Author: Patrick Griffis <pgriffis igalia com>
Date:   Tue Jun 14 13:27:59 2022 -0500

    WebExtensions: Fix handling tabs replying to messages early
    
    Part-of: <https://gitlab.gnome.org/GNOME/epiphany/-/merge_requests/1145>

 src/webextension/ephy-web-extension-manager.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/src/webextension/ephy-web-extension-manager.c b/src/webextension/ephy-web-extension-manager.c
index c2d056012..727e22841 100644
--- a/src/webextension/ephy-web-extension-manager.c
+++ b/src/webextension/ephy-web-extension-manager.c
@@ -1433,12 +1433,12 @@ tab_emit_ready_cb (GObject      *source,
   if (error || !jsc_value_to_boolean (webkit_javascript_result_get_js_value (js_result))) {
     pending_messages = g_hash_table_lookup (manager->pending_messages, tracker->web_extension);
     pending_task = g_hash_table_lookup (pending_messages, tracker->message_guid);
-    g_assert (pending_task);
+    if (pending_task) {
+      g_assert (g_hash_table_steal (pending_messages, tracker->message_guid));
+      g_clear_pointer (&tracker->message_guid, g_free);
 
-    g_assert (g_hash_table_steal (pending_messages, tracker->message_guid));
-    g_clear_pointer (&tracker->message_guid, g_free);
-
-    g_task_return_pointer (pending_task, NULL, NULL);
+      g_task_return_pointer (pending_task, NULL, NULL);
+    }
   }
 
   if (error)


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