RPS service: Fix - handle case of nonexisting sub
authorJulius Bünger <buenger@mytum.de>
Thu, 11 Oct 2018 18:31:33 +0000 (20:31 +0200)
committerJulius Bünger <buenger@mytum.de>
Thu, 11 Oct 2018 18:31:33 +0000 (20:31 +0200)
src/rps/gnunet-service-rps.c

index b41a77074e0efa08eca175a1be02bf5b6bad6667..791c5328c1bdfcf1fa47633ac614eb671372f002 100644 (file)
@@ -2163,8 +2163,16 @@ send_view (const struct ClientContext *cli_ctx,
 
   if (NULL == view_array)
   {
-    view_size = View_size (cli_ctx->sub->view);
-    view_array = View_get_as_array (cli_ctx->sub->view);
+    if (NULL == cli_ctx->sub)
+    {
+      view_size = View_size (msub->view);
+      view_array = View_get_as_array (msub->view);
+    }
+    else
+    {
+      view_size = View_size (cli_ctx->sub->view);
+      view_array = View_get_as_array (cli_ctx->sub->view);
+    }
   }
 
   ev = GNUNET_MQ_msg_extra (out_msg,