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



commit 8dbb47647700df99c1d7fc76f0b7754f4872aef0
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]