session: Don't try to send packets if no session has been set.
This indicates a bug, but let's not segfault if it happens.
This commit is contained in:
parent
04c2f202f2
commit
79f92686c6
|
@ -676,6 +676,11 @@ SR_PRIV int sr_session_send(const struct sr_dev_inst *sdi,
|
|||
return SR_ERR_ARG;
|
||||
}
|
||||
|
||||
if (!sdi->session) {
|
||||
sr_err("%s: session was NULL", __func__);
|
||||
return SR_ERR_BUG;
|
||||
}
|
||||
|
||||
for (l = sdi->session->datafeed_callbacks; l; l = l->next) {
|
||||
if (sr_log_loglevel_get() >= SR_LOG_DBG)
|
||||
datafeed_dump(packet);
|
||||
|
|
Loading…
Reference in New Issue