[gvfs/gnome-2-28] Handle error case in cache lookup correctly



commit eff994cc20d177113989aa3a2160a9a30b70f4bc
Author: Alexander Larsson <alexl redhat com>
Date:   Tue Dec 1 11:15:47 2009 +0100

    Handle error case in cache lookup correctly
    
    If we're in error, we should return NULL, not an uninitialized info.
    (cherry picked from commit a17a5d9e3a13c0bf516a0955e79a1620efa00c6d)

 daemon/gvfsftpdircache.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/daemon/gvfsftpdircache.c b/daemon/gvfsftpdircache.c
index e357edd..dffebbc 100644
--- a/daemon/gvfsftpdircache.c
+++ b/daemon/gvfsftpdircache.c
@@ -216,10 +216,10 @@ g_vfs_ftp_dir_cache_lookup_file_internal (GVfsFtpDirCache *  cache,
       g_vfs_ftp_dir_cache_entry_unref (entry);
     }
 
-  if (!g_vfs_ftp_task_is_in_error (task))
-    info = cache->funcs->lookup_uncached (task, file);
+  if (g_vfs_ftp_task_is_in_error (task))
+    return NULL;
 
-  return info;
+  return cache->funcs->lookup_uncached (task, file);
 }
 
 static GFileInfo *



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]