[gnome-photos/wip/rishi/assert-more: 2/6] view-container: Be more strict about what is acceptable




commit 70cb4472ab5350baad781752522f6c6ba8c20fd6
Author: Debarshi Ray <debarshir gnome org>
Date:   Sun Mar 14 18:33:49 2021 +0100

    view-container: Be more strict about what is acceptable
    
    https://gitlab.gnome.org/GNOME/gnome-photos/-/merge_requests/179

 src/photos-view-container.c | 3 +++
 1 file changed, 3 insertions(+)
---
diff --git a/src/photos-view-container.c b/src/photos-view-container.c
index 3f87c1e0..dc792516 100644
--- a/src/photos-view-container.c
+++ b/src/photos-view-container.c
@@ -549,6 +549,8 @@ photos_view_container_activate_result (PhotosViewContainer *self)
   PhotosBaseItem *item;
   PhotosBaseManager *item_mngr_chld;
 
+  g_return_if_fail (PHOTOS_IS_VIEW_CONTAINER (self));
+
   item_mngr_chld = photos_item_manager_get_for_mode (PHOTOS_ITEM_MANAGER (self->item_mngr), self->mode);
   item = PHOTOS_BASE_ITEM (g_list_model_get_object (G_LIST_MODEL (item_mngr_chld), 0));
   photos_base_manager_set_active_object (self->item_mngr, G_OBJECT (item));
@@ -558,5 +560,6 @@ photos_view_container_activate_result (PhotosViewContainer *self)
 const gchar *
 photos_view_container_get_name (PhotosViewContainer *self)
 {
+  g_return_val_if_fail (PHOTOS_IS_VIEW_CONTAINER (self), NULL);
   return self->name;
 }


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