[nautilus/wip/antoniof/new-list-view-continuation: 7/32] files-view: Don't abort on subdirectory methods




commit 2715c99d5f9295705da908010739673be5d9ad87
Author: António Fernandes <antoniof gnome org>
Date:   Wed Apr 6 00:40:26 2022 +0100

    files-view: Don't abort on subdirectory methods
    
    There is no unrecoverable error as far as I can see. Instead return
    early if the this programming error happens.

 src/nautilus-files-view.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/src/nautilus-files-view.c b/src/nautilus-files-view.c
index 3b38a1413..93e9ddc69 100644
--- a/src/nautilus-files-view.c
+++ b/src/nautilus-files-view.c
@@ -4743,7 +4743,7 @@ nautilus_files_view_add_subdirectory (NautilusFilesView *view,
 
     priv = nautilus_files_view_get_instance_private (view);
 
-    g_assert (!g_list_find (priv->subdirectory_list, directory));
+    g_return_if_fail (!g_list_find (priv->subdirectory_list, directory));
 
     nautilus_directory_ref (directory);
 
@@ -4778,7 +4778,7 @@ nautilus_files_view_remove_subdirectory (NautilusFilesView *view,
     NautilusFilesViewPrivate *priv;
     priv = nautilus_files_view_get_instance_private (view);
 
-    g_assert (g_list_find (priv->subdirectory_list, directory));
+    g_return_if_fail (g_list_find (priv->subdirectory_list, directory));
 
     priv->subdirectory_list = g_list_remove (
         priv->subdirectory_list, directory);


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