[gnome-builder/wip/chergert/debugger: 34/46] mi2: synthesize closed error



commit fb84ab0ecff651b67ab8e57cdf58172f6e35f78c
Author: Christian Hergert <chergert redhat com>
Date:   Fri Mar 24 03:56:49 2017 -0700

    mi2: synthesize closed error

 contrib/mi2/mi2-input-stream.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)
---
diff --git a/contrib/mi2/mi2-input-stream.c b/contrib/mi2/mi2-input-stream.c
index d513be0..d2cbb3b 100644
--- a/contrib/mi2/mi2-input-stream.c
+++ b/contrib/mi2/mi2-input-stream.c
@@ -79,6 +79,15 @@ mi2_input_stream_read_message_read_line_cb (GObject      *object,
       return;
     }
 
+  if (line == NULL)
+    {
+      g_task_return_new_error (task,
+                               G_IO_ERROR,
+                               G_IO_ERROR_CLOSED,
+                               "The stream has closed");
+      return;
+    }
+
   /* Let Mi2Message decode the protocol content */
   if (NULL == (message = mi2_message_parse (line, len, &error)))
     {


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