[libdazzle] app: prevent warning by first looking up in hashtable
- From: Christian Hergert <chergert src gnome org>
 
- To: commits-list gnome org
 
- Cc: 
 
- Subject: [libdazzle] app: prevent warning by first looking up in hashtable
 
- Date: Fri,  1 Sep 2017 21:21:11 +0000 (UTC)
 
commit 77a08a30dd1b179bf49ab2b956c4cc3ca9f4372a
Author: Christian Hergert <chergert redhat com>
Date:   Fri Sep 1 14:21:01 2017 -0700
    app: prevent warning by first looking up in hashtable
 src/app/dzl-application.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/src/app/dzl-application.c b/src/app/dzl-application.c
index a0c2f0a..e45cbdc 100644
--- a/src/app/dzl-application.c
+++ b/src/app/dzl-application.c
@@ -157,8 +157,9 @@ dzl_application_real_remove_resources (DzlApplication *self,
   merge_id = GPOINTER_TO_UINT (g_hash_table_lookup (priv->menu_merge_ids, resource_path));
   if (merge_id != 0)
     {
+      if (g_hash_table_contains (priv->menu_merge_ids, resource_path))
+        g_hash_table_remove (priv->menu_merge_ids, resource_path);
       dzl_menu_manager_remove (priv->menu_manager, merge_id);
-      g_hash_table_remove (priv->menu_merge_ids, resource_path);
     }
 
   /* Remove keythemes path from the shortcuts manager */
[
Date Prev][
Date Next]   [
Thread Prev][
Thread Next]   
[
Thread Index]
[
Date Index]
[
Author Index]