permit NULL head
authorChristian Grothoff <christian@grothoff.org>
Fri, 24 Feb 2017 13:12:03 +0000 (14:12 +0100)
committerChristian Grothoff <christian@grothoff.org>
Fri, 24 Feb 2017 13:12:03 +0000 (14:12 +0100)
src/cadet/gnunet-service-cadet-new_tunnels.c

index 05a1e071d6d350f38ee43b3eae0d7ca78b856967..9d87f9e030c5a6a2151d8b9b1cbcc8a3c50065ed 100644 (file)
@@ -603,8 +603,11 @@ GCT_count_any_connections (const struct CadetTunnel *t)
 static struct CadetTConnection *
 get_ready_connection (struct CadetTunnel *t)
 {
-  GNUNET_assert (GNUNET_YES == t->connection_ready_head->is_ready);
-  return t->connection_ready_head;
+  struct CadetTConnection *hd = t->connection_ready_head;
+
+  GNUNET_assert ( (NULL == hd) ||
+                  (GNUNET_YES == hd->is_ready) );
+  return hd;
 }