n_conn->_base.address, n_conn->_base.port);
n_conn->is_bad_for_new_circs = 1;
}
- entry_guard_register_connect_status(n_conn_id, 0, time(NULL));
- /* if there are any one-hop streams waiting on this circuit, fail
- * them now so they can retry elsewhere. */
- connection_ap_fail_onehop(n_conn_id, circ->build_state);
+ if (circ->_base.n_hop) {
+ const char *n_conn_id = circ->_base.n_hop->identity_digest;
+ entry_guard_register_connect_status(n_conn_id, 0, time(NULL));
+ /* if there are any one-hop streams waiting on this circuit, fail
+ * them now so they can retry elsewhere. */
+ connection_ap_fail_onehop(n_conn_id, circ->build_state);
+ }
}
switch (circ->_base.purpose) {