[nautilus/wip/corey/dnd_features: 3/7] list-base: Fix crash when checking preferred action




commit e191fd5a65dfcb85a9f55fe23abcda8de18cadea
Author: Corey Berla <corey berla me>
Date:   Thu Aug 18 09:40:17 2022 -0700

    list-base: Fix crash when checking preferred action

 src/nautilus-list-base.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
---
diff --git a/src/nautilus-list-base.c b/src/nautilus-list-base.c
index deb3a122e..568f2328c 100644
--- a/src/nautilus-list-base.c
+++ b/src/nautilus-list-base.c
@@ -624,7 +624,14 @@ get_preferred_action (NautilusFile *target_file,
     else if (G_VALUE_HOLDS (value, GDK_TYPE_FILE_LIST))
     {
         GSList *source_file_list = g_value_get_boxed (value);
-        action = nautilus_dnd_get_preferred_action (target_file, source_file_list->data);
+        if (source_file_list != NULL)
+        {
+            action = nautilus_dnd_get_preferred_action (target_file, source_file_list->data);
+        }
+        else
+        {
+            action = nautilus_dnd_get_preferred_action (target_file, NULL);
+        }
     }
     else if (G_VALUE_HOLDS (value, G_TYPE_STRING))
     {


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