[gconf/gnome-2-26] Avoid assertion failures



commit 1097e92ee055bd73f1dbd3aec9f438efd04adf8c
Author: Matthias Clasen <mclasen redhat com>
Date:   Thu May 14 11:11:25 2009 -0400

    Avoid assertion failures
    
    The neg-caching patch changed the behaviour of the internal
    gconf_client_lookup function. It can now return TRUE, but still
    leave entry NULL. Adjust callers. This fixes bug 581905.
---
 gconf/gconf-client.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/gconf/gconf-client.c b/gconf/gconf-client.c
index da050ec..98f2051 100644
--- a/gconf/gconf-client.c
+++ b/gconf/gconf-client.c
@@ -1199,7 +1199,8 @@ gconf_client_key_is_writable (GConfClient* client,
 
   if (gconf_client_lookup (client, key, &entry))
     {
-      g_assert (entry != NULL);
+      if (!entry)
+        return FALSE;
 
       trace ("CACHED: Checking whether key '%s' is writable", key);
       return gconf_entry_get_is_writable (entry);
@@ -1406,7 +1407,8 @@ gconf_client_get_default_from_schema (GConfClient* client,
    */
   if (gconf_client_lookup (client, key, &entry))
     {
-      g_assert (entry != NULL);
+      if (!entry)
+        return NULL;
 
       if (gconf_entry_get_is_default (entry))
         {
@@ -2498,7 +2500,7 @@ gconf_client_flush_notifies (GConfClient *client)
     {
       GConfEntry *entry = NULL;
 
-      if (gconf_client_lookup (client, tmp->data, &entry))
+      if (gconf_client_lookup (client, tmp->data, &entry) && entry != NULL)
         {
           if (entry != last_entry)
             {



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