[gnome-control-center/gnome-3-30] object-cache: Assert task_data before using it



commit 22957ff55a3dfdfa0d59451306d838e6fa91de21
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Tue Sep 25 20:46:22 2018 -0300

    object-cache: Assert task_data before using it
    
    It is not useful to assert that task_data != NULL after
    using it to build the D-Bus key.
    
    Move the assertion to before it is first used and get
    rid of this inconsistency.

 shell/cc-object-storage.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/shell/cc-object-storage.c b/shell/cc-object-storage.c
index 7aeafb1fd..2865a3661 100644
--- a/shell/cc-object-storage.c
+++ b/shell/cc-object-storage.c
@@ -362,6 +362,7 @@ cc_object_storage_create_dbus_proxy_finish (GAsyncResult  *result,
   g_assert (!error || !*error);
 
   task_data = g_task_get_task_data (task);
+  g_assert (task_data != NULL);
 
   /* Retrieve the newly created proxy */
   proxy = g_task_propagate_pointer (task, &local_error);
@@ -386,7 +387,6 @@ cc_object_storage_create_dbus_proxy_finish (GAsyncResult  *result,
    * proxy asynchronously multiple times. Trying to do so is considered a programming
    * error.
    */
-  g_assert (task_data != NULL);
   g_assert (task_data->cached == cc_object_storage_has_object (key));
 
   /* If the proxy is already cached, destroy the newly created and used the cached proxy


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