octoi: Prevent segfault on 'show octoi-clients if a client has no line

This can happen if the specified device in the config isn't plugged
in for instance, no line is created ...

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
Change-Id: I594463591f2945a04ccd708f16788034cc1dfc57
This commit is contained in:
Sylvain Munaut 2022-10-12 22:16:12 +02:00
parent 9d45233337
commit 6005fb3ea8
1 changed files with 4 additions and 2 deletions

View File

@ -240,7 +240,9 @@ void vty_show_octoi_sock(struct vty *vty, struct octoi_sock *sock)
vty_out(vty, " Peer '%s', Remote "OSMO_SOCKADDR_STR_FMT", State %s%s",
peer->name, OSMO_SOCKADDR_STR_FMT_ARGS(&peer->cfg.remote),
osmo_fsm_inst_state_name(peer->priv), VTY_NEWLINE);
vty_out_rate_ctr_group(vty, " ", peer->iline->ctrs);
vty_out_stat_item_group(vty, " ", peer->iline->stats);
if (peer->iline) {
vty_out_rate_ctr_group(vty, " ", peer->iline->ctrs);
vty_out_stat_item_group(vty, " ", peer->iline->stats);
}
}
}