vty: fix segfault if rf_ctl is not set

This is the case of osmo-nitb, since it does not call
osmo_bsc_rf_create().

term1: $ ./osmo-nitb -c ../openbsc.cfg.nanobts
term2: $ telnet localhost 4242
term2: OpenBSC> show network
term1: Segmentation fault
This commit is contained in:
Pablo Neira Ayuso 2011-03-08 13:35:17 +01:00 committed by Holger Hans Peter Freyther
parent 16b7f5c4ef
commit 682587748f
1 changed files with 1 additions and 1 deletions

View File

@ -189,7 +189,7 @@ static void net_dump_vty(struct vty *vty, struct gsm_network *net)
dump_pchan_load_vty(vty, " ", &pl);
/* show rf */
if (net->msc_data)
if (net->msc_data && net->msc_data->rf_ctl)
vty_out(vty, " Last RF Command: %s%s",
net->msc_data->rf_ctl->last_state_command,
VTY_NEWLINE);