If there is no default agent, then current agent also will
be NULL. So, call stk_agent_request_cancel only when there is a valid
current agent.
static void stk_alpha_id_unset(struct ofono_stk *stk)
{
- stk_agent_request_cancel(stk->current_agent);
+ /*
+ * If there is no default agent, then current agent also will be NULL.
+ * So, call request cancel only when there is a valid current agent.
+ */
+ if (stk->current_agent)
+ stk_agent_request_cancel(stk->current_agent);
}
static int duration_to_msecs(const struct stk_duration *duration)