[gnome-builder/wip/chergert/debugger: 36/38] mi2: synthesize closed error
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder/wip/chergert/debugger: 36/38] mi2: synthesize closed error
- Date: Fri, 24 Mar 2017 11:44:56 +0000 (UTC)
commit b1e13483612cd1cee69cc2c837e3f6d85795d827
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]