agent: Only cancel if default agent is registered

If we do not have a default agent registered, then do not try
to cancel a request as there will not be one.
This commit is contained in:
Jukka Rissanen 2015-03-06 11:01:10 +02:00 committed by Denis Kenzior
parent c05c54a22b
commit 84d61c521f
1 changed files with 3 additions and 0 deletions

View File

@ -284,6 +284,9 @@ bool agent_request_cancel(unsigned int req_id)
{
struct agent_request *request;
if (!default_agent)
return false;
request = l_queue_remove_if(default_agent->requests, find_request,
L_UINT_TO_PTR(req_id));
if (!request)