[virt-tools-list] [PATCH virt-viewer] spice: avoid crash if connection failed without error

Marc-André Lureau marcandre.lureau at gmail.com
Mon Jul 21 15:59:19 UTC 2014


spice_channel_get_error() is not guarantee to return a GError.
---
 src/virt-viewer-session-spice.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/virt-viewer-session-spice.c b/src/virt-viewer-session-spice.c
index 2d4e67d..8b90d66 100644
--- a/src/virt-viewer-session-spice.c
+++ b/src/virt-viewer-session-spice.c
@@ -547,7 +547,7 @@ virt_viewer_session_spice_main_channel_event(SpiceChannel *channel G_GNUC_UNUSED
                 spice_session_connect(self->priv->session);
             }
         } else {
-            g_signal_emit_by_name(session, "session-disconnected", error->message);
+            g_signal_emit_by_name(session, "session-disconnected", error ? error->message : NULL);
         }
     }
 #else
-- 
1.9.3




More information about the virt-tools-list mailing list