[gnome-builder/gnome-builder-3-28] flatpak: check for enumerator failure



commit 59531e2b9fed1a03674455ccebc55f2c543c6a3f
Author: Christian Hergert <chergert redhat com>
Date:   Wed Aug 8 13:32:32 2018 -0700

    flatpak: check for enumerator failure

 src/plugins/flatpak/gbp-flatpak-build-system-discovery.c | 6 ++++++
 1 file changed, 6 insertions(+)
---
diff --git a/src/plugins/flatpak/gbp-flatpak-build-system-discovery.c 
b/src/plugins/flatpak/gbp-flatpak-build-system-discovery.c
index 30f295951..f0725d61f 100644
--- a/src/plugins/flatpak/gbp-flatpak-build-system-discovery.c
+++ b/src/plugins/flatpak/gbp-flatpak-build-system-discovery.c
@@ -49,6 +49,9 @@ gbp_flatpak_build_system_discovery_find_manifests (GFile        *directory,
   g_assert (results != NULL);
   g_assert (depth < DISCOVERY_MAX_DEPTH);
 
+  if (g_cancellable_is_cancelled (cancellable))
+    return;
+
   enumerator = g_file_enumerate_children (directory,
                                           G_FILE_ATTRIBUTE_STANDARD_IS_SYMLINK","
                                           G_FILE_ATTRIBUTE_STANDARD_NAME","
@@ -57,6 +60,9 @@ gbp_flatpak_build_system_discovery_find_manifests (GFile        *directory,
                                           cancellable,
                                           NULL);
 
+  if (enumerator == NULL)
+    return;
+
   while (NULL != (infoptr = g_file_enumerator_next_file (enumerator, cancellable, NULL)))
     {
       g_autoptr(GFileInfo) info = infoptr;


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