summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Vogelgesang <matthias.vogelgesang@kit.edu>2016-02-18 12:32:00 +0100
committerMatthias Vogelgesang <matthias.vogelgesang@kit.edu>2016-02-18 12:32:00 +0100
commit78ef5159fcc54dc8d4fa30a5949a8676e0d304c0 (patch)
treecc64af553c37e80977f7ae43795fada249cfb289
parent01fdd893ced1f534eea2de39dc363c9e1f43d391 (diff)
downloaduca-net-78ef5159fcc54dc8d4fa30a5949a8676e0d304c0.tar.gz
uca-net-78ef5159fcc54dc8d4fa30a5949a8676e0d304c0.tar.bz2
uca-net-78ef5159fcc54dc8d4fa30a5949a8676e0d304c0.tar.xz
uca-net-78ef5159fcc54dc8d4fa30a5949a8676e0d304c0.zip
Fix segfault if server is not running
-rw-r--r--uca-net-camera.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/uca-net-camera.c b/uca-net-camera.c
index 849d446..d9d561b 100644
--- a/uca-net-camera.c
+++ b/uca-net-camera.c
@@ -520,10 +520,12 @@ uca_net_camera_constructed (GObject *object)
priv->connection = g_socket_client_connect_to_host (priv->client, priv->host, UCA_NET_DEFAULT_PORT, NULL, &priv->construct_error);
- /* ask for additional camera properties */
- if (send_default_message (priv->connection, UCA_NET_MESSAGE_GET_PROPERTIES, &priv->construct_error))
- read_get_properties_reply (object, g_io_stream_get_input_stream (G_IO_STREAM (priv->connection)),
- &priv->construct_error);
+ if (priv->connection != NULL) {
+ /* ask for additional camera properties */
+ if (send_default_message (priv->connection, UCA_NET_MESSAGE_GET_PROPERTIES, &priv->construct_error))
+ read_get_properties_reply (object, g_io_stream_get_input_stream (G_IO_STREAM (priv->connection)),
+ &priv->construct_error);
+ }
}
static void