summaryrefslogtreecommitdiff
path: root/gio/gfile.c
diff options
context:
space:
mode:
authorMatthias Clasen <matthiasc@src.gnome.org>2008-07-18 17:48:30 +0000
committerMatthias Clasen <matthiasc@src.gnome.org>2008-07-18 17:48:30 +0000
commit3cb92eb95e0681007513a2fd5ef23c7def3f560d (patch)
treeb6c0120e80ea8862e2a9f9f0d714860e05b299a9 /gio/gfile.c
parent38d4e3fd4869655359a87a2ad4e647721f39df76 (diff)
Fix a segfault
svn path=/trunk/; revision=7200
Diffstat (limited to 'gio/gfile.c')
-rw-r--r--gio/gfile.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/gio/gfile.c b/gio/gfile.c
index 2dd40ba00..e056942a1 100644
--- a/gio/gfile.c
+++ b/gio/gfile.c
@@ -4198,6 +4198,18 @@ open_read_async_thread (GSimpleAsyncResult *res,
iface = G_FILE_GET_IFACE (object);
+ if (iface->read_fn == NULL)
+ {
+ g_set_error_literal (error, G_IO_ERROR,
+ G_IO_ERROR_NOT_SUPPORTED,
+ _("Operation not supported"));
+
+ g_simple_async_result_set_from_error (res, error);
+ g_error_free (error);
+
+ return;
+ }
+
stream = iface->read_fn (G_FILE (object), cancellable, &error);
if (stream == NULL)