If we fail to open a file, task->file_stream will be NULL, so we should
not call g_input_stream_close on it.

Signed-off-by: Hans de Goede <hdego...@redhat.com>
---
 gtk/channel-main.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/gtk/channel-main.c b/gtk/channel-main.c
index c7ac12d..5a05651 100644
--- a/gtk/channel-main.c
+++ b/gtk/channel-main.c
@@ -2591,6 +2591,11 @@ static void file_xfer_completed(SpiceFileXferTask *task, 
GError *error)
     if (task->pending)
         return;
 
+    if (!task->file_stream) {
+        file_xfer_close_cb(NULL, NULL, task);
+        return;
+    }
+
     g_input_stream_close_async(G_INPUT_STREAM(task->file_stream),
                                G_PRIORITY_DEFAULT,
                                task->cancellable,
-- 
1.8.1.4

_______________________________________________
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/spice-devel

Reply via email to