[gnome-photos/wip/rishi/misc-fixes: 7/24] base-item: Access the internals only after IS_BASE_ITEM has passed



commit 8aff8235333a05726037b1d4ef4384db99e92e28
Author: Debarshi Ray <debarshir gnome org>
Date:   Fri Dec 18 13:31:42 2015 +0100

    base-item: Access the internals only after IS_BASE_ITEM has passed

 src/photos-base-item.c |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)
---
diff --git a/src/photos-base-item.c b/src/photos-base-item.c
index 593c7bd..2cab807 100644
--- a/src/photos-base-item.c
+++ b/src/photos-base-item.c
@@ -782,10 +782,11 @@ photos_base_item_load_buffer_async (PhotosBaseItem *self,
                                     GAsyncReadyCallback callback,
                                     gpointer user_data)
 {
-  PhotosBaseItemPrivate *priv = self->priv;
+  PhotosBaseItemPrivate *priv;
   GTask *task;
 
   g_return_if_fail (PHOTOS_IS_BASE_ITEM (self));
+  priv = self->priv;
 
   if (priv->load_graph == NULL)
     {
@@ -1758,10 +1759,11 @@ photos_base_item_load_async (PhotosBaseItem *self,
                              GAsyncReadyCallback callback,
                              gpointer user_data)
 {
-  PhotosBaseItemPrivate *priv = self->priv;
+  PhotosBaseItemPrivate *priv;
   GTask *task;
 
   g_return_if_fail (PHOTOS_IS_BASE_ITEM (self));
+  priv = self->priv;
 
   task = g_task_new (self, cancellable, callback, user_data);
   g_task_set_source_tag (task, photos_base_item_load_async);
@@ -1905,11 +1907,13 @@ photos_base_item_save_async (PhotosBaseItem *self,
                              GAsyncReadyCallback callback,
                              gpointer user_data)
 {
-  PhotosBaseItemPrivate *priv = self->priv;
+  PhotosBaseItemPrivate *priv;
   GFile *file;
   GTask *task;
 
   g_return_if_fail (PHOTOS_IS_BASE_ITEM (self));
+  priv = self->priv;
+
   g_return_if_fail (uri != NULL && uri[0] != '\0');
   g_return_if_fail (type != NULL && type[0] != '\0');
   g_return_if_fail (priv->edit_graph != NULL);


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