Fix a segfault

svn path=/trunk/; revision=7200
This commit is contained in:
Matthias Clasen
2008-07-18 17:48:30 +00:00
parent 38d4e3fd48
commit 3cb92eb95e
2 changed files with 31 additions and 0 deletions

View File

@@ -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)