summaryrefslogtreecommitdiff
path: root/client/gdaemonfileinputstream.c
diff options
context:
space:
mode:
authorAlexander Larsson <alexl@redhat.com>2008-10-09 10:21:03 +0000
committerAlexander Larsson <alexl@src.gnome.org>2008-10-09 10:21:03 +0000
commit2ec89fbd8ae01bd7d3b2df4e698f1a221964b4bd (patch)
tree24021695899a964f546080aa378b2d3c8bb9c684 /client/gdaemonfileinputstream.c
parent65d800e956a95853cbe50feae01cb3d1f19fa75c (diff)
downloadgvfs-2ec89fbd8ae01bd7d3b2df4e698f1a221964b4bd.tar.gz
Add some debug spew and avoid crashing in case of code not properly
2008-10-09 Alexander Larsson <alexl@redhat.com> * client/gdaemonfileinputstream.c: (run_sync_state_machine): Add some debug spew and avoid crashing in case of code not properly setting the GError, as reported on the list. svn path=/trunk/; revision=2046
Diffstat (limited to 'client/gdaemonfileinputstream.c')
-rw-r--r--client/gdaemonfileinputstream.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/client/gdaemonfileinputstream.c b/client/gdaemonfileinputstream.c
index 8cdc3622..c6341a4f 100644
--- a/client/gdaemonfileinputstream.c
+++ b/client/gdaemonfileinputstream.c
@@ -446,8 +446,14 @@ run_sync_state_machine (GDaemonFileInputStream *file,
}
else
{
+ /* We got reports of this crashing with io_error NULL. That shouldn't
+ happen, so try to spew some debug info and avoid crashing. */
+ if (io_error == NULL)
+ g_warning ("run_sync_state_machine got error but no GError set. This should not happen. io_op was: %d\n",
+ io_op);
g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
- _("Error in stream protocol: %s"), io_error->message);
+ _("Error in stream protocol: %s"),
+ io_error ? io_error->message : "Unknown error");
g_error_free (io_error);
return FALSE;
}