handle NULL better
authorChristian Grothoff <christian@grothoff.org>
Mon, 31 Oct 2011 11:48:52 +0000 (11:48 +0000)
committerChristian Grothoff <christian@grothoff.org>
Mon, 31 Oct 2011 11:48:52 +0000 (11:48 +0000)
src/mesh/gnunet-service-mesh.c

index fd37bb85ef8f2e4965f134964a4d5077b87fd08d..2e9917c3ff7e43d60b1d49e02c7a27fd6df03d30 100644 (file)
@@ -1503,21 +1503,23 @@ path_add_to_peer (struct MeshPeerInfo *peer_info, struct MeshPeerPath *path)
   unsigned int l;
   unsigned int l2;
 
-#if MESH_DEBUG
-  struct GNUNET_PeerIdentity id;
-
-  GNUNET_PEER_resolve (peer_info->id, &id);
-  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-              "MESH: adding path [%u] to peer %s\n",
-              path->length,
-              GNUNET_i2s (&id));
-#endif
-  if (NULL == peer_info || NULL == path)
+  if ((NULL == peer_info) || (NULL == path))
   {
     GNUNET_break (0);
     path_destroy (path);
     return;
   }
+#if MESH_DEBUG
+  { 
+    struct GNUNET_PeerIdentity id;
+    
+    GNUNET_PEER_resolve (peer_info->id, &id);
+    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+               "MESH: adding path [%u] to peer %s\n",
+               path->length,
+               GNUNET_i2s (&id));
+  }
+#endif
 
   l = path_get_length (path);
   if (0 == l)