Commit 57e00690 authored by Debarshi Ray's avatar Debarshi Ray

pipeline: Transparently handle deserialization errors

We already handle cases where there is nothing to restore from, so it
seems reasonable to handle deserialization errors too.
parent ca964e19
......@@ -245,9 +245,6 @@ photos_pipeline_async_initable_init_load_contents (GObject *source_object, GAsyn
parent = gegl_node_get_parent (self->graph);
g_clear_object (&self->graph);
/* HACK: This graph is busted. eg., the input and output proxies
* point to the same GeglNode. I can't imagine this to be
* anything else other than a GEGL bug.
......@@ -258,10 +255,17 @@ photos_pipeline_async_initable_init_load_contents (GObject *source_object, GAsyn
graph = gegl_node_new_from_xml (contents, "/");
if (graph == NULL)
g_task_return_new_error (task, PHOTOS_ERROR, 0, "Failed to deserialize from XML");
goto out;
gchar *uri;
uri = g_file_get_uri (file);
g_warning ("Unable to deserialize from %s", uri);
g_free (uri);
goto carry_on;
parent = gegl_node_get_parent (self->graph);
g_clear_object (&self->graph);
self->graph = gegl_node_new ();
if (parent != NULL)
gegl_node_add_child (parent, self->graph);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment