diff options
-rw-r--r-- | src/icipc-client.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/icipc-client.c b/src/icipc-client.c index aa71b1f..587878c 100644 --- a/src/icipc-client.c +++ b/src/icipc-client.c @@ -24,11 +24,16 @@ reply_handler (struct icipc_sender *self, const uint8_t *buffer, size_t size, vo { struct client_data *data = p; const char *error = NULL; - const struct spa_pod *pod = icipc_client_send_request_finish (self, buffer, size, &error); - if (!pod) - printf ("error: %s\n", error ? error : "unknown"); - else - printf ("success!\n"); + + if (buffer) { + const struct spa_pod *pod = icipc_client_send_request_finish (self, buffer, size, &error); + if (!pod) + printf ("error: %s\n", error ? error : "unknown"); + else + printf ("success!\n"); + } else { + printf ("error: lost connection with server\n"); + } /* signal reply received */ pthread_mutex_lock (&data->mutex); |