*
* @return peerinfo of the peer who is the first hop in the tunnel
* NULL on error
- *
+ *
* FIXME use PEER_Id
*/
struct GNUNET_PeerIdentity *
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "tree: Deleting path to %s.\n",
GNUNET_i2s (&id));
#endif
- if (peer_id == t->root->peer)
+ if (NULL == t->root || peer_id == t->root->peer)
return NULL;
for (n = t->disconnected_head; NULL != n; n = n->next)