diff options
author | Alexander Larsson <alexl@src.gnome.org> | 2007-09-13 13:57:50 +0000 |
---|---|---|
committer | Alexander Larsson <alexl@src.gnome.org> | 2007-09-13 13:57:50 +0000 |
commit | b3d92ba9a95013d985efd58cf1dbb2a61cc718b0 (patch) | |
tree | 4f680ce98ef073f5b740b1cdd3e7ca3cf40b19a2 /daemon/gvfsjobopenforread.c | |
parent | 2c4aa53f53174bddaeafce332c709a4e0869275d (diff) | |
download | gvfs-b3d92ba9a95013d985efd58cf1dbb2a61cc718b0.tar.gz |
Check for unsupported operations and return error instead of crashing,
Original git commit by Alexander Larsson <alexl@redhat.com> at 1183457271 +0200
svn path=/trunk/; revision=604
Diffstat (limited to 'daemon/gvfsjobopenforread.c')
-rw-r--r-- | daemon/gvfsjobopenforread.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/daemon/gvfsjobopenforread.c b/daemon/gvfsjobopenforread.c index 2fdcbdb7..e5ff6951 100644 --- a/daemon/gvfsjobopenforread.c +++ b/daemon/gvfsjobopenforread.c @@ -102,6 +102,13 @@ run (GVfsJob *job) GVfsJobOpenForRead *op_job = G_VFS_JOB_OPEN_FOR_READ (job); GVfsBackendClass *class = G_VFS_BACKEND_GET_CLASS (op_job->backend); + if (class->open_for_read == NULL) + { + g_vfs_job_failed (job, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED, + _("Operation not supported by backend")); + return; + } + class->open_for_read (op_job->backend, op_job, op_job->filename); |