[recipes] Don't crash if a recipe is missing for export



commit 6f520b0d80b9006fa85fb740b45f5af61d00088f
Author: Matthias Clasen <mclasen redhat com>
Date:   Sat May 27 21:35:20 2017 -0400

    Don't crash if a recipe is missing for export
    
    Now that we store the export list persistently, it can
    happen that a recipe disappears from the dataset while
    it is still on the export list. Silently skip it if
    that is the case, instead of crashing.

 src/gr-recipe-exporter.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/src/gr-recipe-exporter.c b/src/gr-recipe-exporter.c
index dadd655..de15afa 100644
--- a/src/gr-recipe-exporter.c
+++ b/src/gr-recipe-exporter.c
@@ -790,7 +790,8 @@ gr_recipe_exporter_export (GrRecipeExporter *exporter,
 
         for (i = 0; keys[i]; i++) {
                 g_autoptr(GrRecipe) r = gr_recipe_store_get_recipe (store, keys[i]);
-                exporter->recipes = g_list_prepend (exporter->recipes, g_object_ref (r));
+                if (r)
+                        exporter->recipes = g_list_prepend (exporter->recipes, g_object_ref (r));
         }
 
         show_export_dialog (exporter);


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